Spaces:
Paused
Paused
update
Browse files
toolbox/porter/tasks/douyin_live_record_task.py
CHANGED
|
@@ -158,15 +158,24 @@ class DouyinLiveRecordTask(BaseTask):
|
|
| 158 |
title = data["title"]
|
| 159 |
|
| 160 |
if status == 4:
|
|
|
|
| 161 |
stream_data = {}
|
| 162 |
else:
|
| 163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
stream_data = stream_data["data"]
|
| 165 |
|
| 166 |
result = {
|
| 167 |
"status": status,
|
| 168 |
"title": title,
|
| 169 |
"stream_data": stream_data,
|
|
|
|
| 170 |
}
|
| 171 |
self.success_rate_of_get_live_info_by_web_enter.append(1)
|
| 172 |
return result
|
|
|
|
| 158 |
title = data["title"]
|
| 159 |
|
| 160 |
if status == 4:
|
| 161 |
+
paid_live_data = {}
|
| 162 |
stream_data = {}
|
| 163 |
else:
|
| 164 |
+
try:
|
| 165 |
+
paid_live_data = data["paid_live_data"]
|
| 166 |
+
stream_data = data["stream_url"]["live_core_sdk_data"]["pull_data"]["stream_data"]
|
| 167 |
+
except KeyError as error:
|
| 168 |
+
logger.info(f"data.keys: {data.keys()}, error type: {type(error)}, error text: {error}, traceback: {traceback.format_exc()}")
|
| 169 |
+
self.success_rate_of_get_live_info_by_web_enter.append(0)
|
| 170 |
+
return None
|
| 171 |
+
stream_data = json.loads(stream_data)
|
| 172 |
stream_data = stream_data["data"]
|
| 173 |
|
| 174 |
result = {
|
| 175 |
"status": status,
|
| 176 |
"title": title,
|
| 177 |
"stream_data": stream_data,
|
| 178 |
+
"paid_live_data": paid_live_data,
|
| 179 |
}
|
| 180 |
self.success_rate_of_get_live_info_by_web_enter.append(1)
|
| 181 |
return result
|