Spaces:
Paused
Paused
update
Browse files
data/porter_tasks/porter_task_songkewei_douyin_video_to_youtube.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
"sec_user_id": "MS4wLjABAAAAs2XhHg7SMVu-STXWpod1zFxTzlnoeWzTXxAE02c7OQ49GMnGiHCcLxk8c3aDPr3s",
|
| 7 |
"check_interval": 900,
|
| 8 |
"key_of_credentials": "douyin_wentao_credentials",
|
| 9 |
-
"
|
| 10 |
"output_video_dir": "data/tasks/songkewei_douyin_video_to_youtube/video/douyin/宋可为",
|
| 11 |
"output_video_info_file": "data/tasks/songkewei_douyin_video_to_youtube/video/douyin/宋可为/file_info.json"
|
| 12 |
},
|
|
|
|
| 6 |
"sec_user_id": "MS4wLjABAAAAs2XhHg7SMVu-STXWpod1zFxTzlnoeWzTXxAE02c7OQ49GMnGiHCcLxk8c3aDPr3s",
|
| 7 |
"check_interval": 900,
|
| 8 |
"key_of_credentials": "douyin_wentao_credentials",
|
| 9 |
+
"min_date": "2020-12-27 00:00:00",
|
| 10 |
"output_video_dir": "data/tasks/songkewei_douyin_video_to_youtube/video/douyin/宋可为",
|
| 11 |
"output_video_info_file": "data/tasks/songkewei_douyin_video_to_youtube/video/douyin/宋可为/file_info.json"
|
| 12 |
},
|
toolbox/bilibili/live/live_manager.py
CHANGED
|
@@ -7,10 +7,8 @@ https://github.com/ChaceQC/bilibili_live_stream_code/blob/master/main/bilibili_l
|
|
| 7 |
|
| 8 |
"""
|
| 9 |
import argparse
|
|
|
|
| 10 |
import logging
|
| 11 |
-
import urllib
|
| 12 |
-
import urllib.parse
|
| 13 |
-
import hashlib
|
| 14 |
|
| 15 |
from tenacity import before_sleep_log, retry, retry_if_exception_type, stop_after_attempt, wait_fixed
|
| 16 |
|
|
|
|
| 7 |
|
| 8 |
"""
|
| 9 |
import argparse
|
| 10 |
+
import json
|
| 11 |
import logging
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
from tenacity import before_sleep_log, retry, retry_if_exception_type, stop_after_attempt, wait_fixed
|
| 14 |
|
toolbox/porter/tasks/douyin_live_record_task.py
CHANGED
|
@@ -273,12 +273,34 @@ class DouyinLiveRecordTask(BaseTask):
|
|
| 273 |
paid_live_data: dict = js.get("paid_live_data") or dict()
|
| 274 |
privilege_info_map: dict = paid_live_data.get("privilege_info_map") or dict()
|
| 275 |
if len(privilege_info_map) != 0:
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
|
| 283 |
live_url = None
|
| 284 |
for quality_code in ("origin", "uhd", "hd", "sd", "md", "ld"):
|
|
|
|
| 273 |
paid_live_data: dict = js.get("paid_live_data") or dict()
|
| 274 |
privilege_info_map: dict = paid_live_data.get("privilege_info_map") or dict()
|
| 275 |
if len(privilege_info_map) != 0:
|
| 276 |
+
# 会员直播似乎可以通过 by_sec_user_id 方法录制到。
|
| 277 |
+
if live_check_method != "by_sec_user_id":
|
| 278 |
+
live_check_method = "by_sec_user_id"
|
| 279 |
+
js = await self.get_live_info_by_sec_user_id()
|
| 280 |
+
if js is None:
|
| 281 |
+
logger.info(f"{self.flag} {live_check_method},尝试录制会员直播失败;")
|
| 282 |
+
return None
|
| 283 |
+
|
| 284 |
+
status: int = js["status"]
|
| 285 |
+
title: str = js["title"]
|
| 286 |
+
stream_data: dict = js["stream_data"]
|
| 287 |
+
metadata = copy.deepcopy(js)
|
| 288 |
+
metadata.pop("stream_data")
|
| 289 |
+
metadata["live_check_method"] = live_check_method
|
| 290 |
+
if status != 2:
|
| 291 |
+
logger.info(f"{self.flag} {live_check_method},未开播;")
|
| 292 |
+
return None
|
| 293 |
+
|
| 294 |
+
# 会员直播
|
| 295 |
+
# paid_live_data: dict = js.get("paid_live_data") or dict()
|
| 296 |
+
# privilege_info_map: dict = paid_live_data.get("privilege_info_map") or dict()
|
| 297 |
+
# if len(privilege_info_map) != 0:
|
| 298 |
+
# for _, v in privilege_info_map.items():
|
| 299 |
+
# paid_live_type = v.get("paid_live_type")
|
| 300 |
+
# ui_config = v.get("ui_config") or dict()
|
| 301 |
+
# paid_live_icon_title = ui_config.get("paid_live_icon_title")
|
| 302 |
+
# logger.info(f"{self.flag}跳过付费直播;live_check_method: {live_check_method}, paid_live_type: {paid_live_type}, paid_live_icon_title: {paid_live_icon_title}")
|
| 303 |
+
# return None
|
| 304 |
|
| 305 |
live_url = None
|
| 306 |
for quality_code in ("origin", "uhd", "hd", "sd", "md", "ld"):
|