Spaces:
Paused
Paused
update
Browse files
toolbox/porter/tasks/douyin_live_record_task.py
CHANGED
|
@@ -205,10 +205,13 @@ class DouyinLiveRecordTask(BaseTask):
|
|
| 205 |
async def do_task(self):
|
| 206 |
room_url = f"https://live.douyin.com/{self.room_id}"
|
| 207 |
|
|
|
|
| 208 |
js = await self.get_live_info_by_web_enter()
|
| 209 |
if js is None:
|
|
|
|
| 210 |
js = await self.get_live_info_by_room_url()
|
| 211 |
if js is None:
|
|
|
|
| 212 |
js = await self.get_live_info_by_follow()
|
| 213 |
|
| 214 |
if js is None:
|
|
@@ -222,7 +225,7 @@ class DouyinLiveRecordTask(BaseTask):
|
|
| 222 |
metadata.pop("stream_data")
|
| 223 |
|
| 224 |
if status != 2:
|
| 225 |
-
logger.info(f"{self.flag}
|
| 226 |
return None
|
| 227 |
|
| 228 |
# 会员直播
|
|
|
|
| 205 |
async def do_task(self):
|
| 206 |
room_url = f"https://live.douyin.com/{self.room_id}"
|
| 207 |
|
| 208 |
+
live_check_method = "web_enter"
|
| 209 |
js = await self.get_live_info_by_web_enter()
|
| 210 |
if js is None:
|
| 211 |
+
live_check_method = "room_url"
|
| 212 |
js = await self.get_live_info_by_room_url()
|
| 213 |
if js is None:
|
| 214 |
+
live_check_method = "follow"
|
| 215 |
js = await self.get_live_info_by_follow()
|
| 216 |
|
| 217 |
if js is None:
|
|
|
|
| 225 |
metadata.pop("stream_data")
|
| 226 |
|
| 227 |
if status != 2:
|
| 228 |
+
logger.info(f"{self.flag}{live_check_method}未开播;")
|
| 229 |
return None
|
| 230 |
|
| 231 |
# 会员直播
|
toolbox/porter/tasks/douyin_live_to_bilibili_live_task.py
CHANGED
|
@@ -140,10 +140,13 @@ class DouyinLiveToBilibiliLiveTask(BaseTask):
|
|
| 140 |
if self.is_streaming:
|
| 141 |
return None
|
| 142 |
|
|
|
|
| 143 |
js = await self.get_live_info_by_web_enter()
|
| 144 |
if js is None:
|
|
|
|
| 145 |
js = await self.get_live_info_by_room_url()
|
| 146 |
if js is None:
|
|
|
|
| 147 |
js = await self.get_live_info_by_follow()
|
| 148 |
|
| 149 |
if js is None:
|
|
@@ -155,7 +158,7 @@ class DouyinLiveToBilibiliLiveTask(BaseTask):
|
|
| 155 |
stream_data: dict = js["stream_data"]
|
| 156 |
|
| 157 |
if status != 2:
|
| 158 |
-
logger.info(f"{self.flag}
|
| 159 |
return None
|
| 160 |
|
| 161 |
live_url = None
|
|
|
|
| 140 |
if self.is_streaming:
|
| 141 |
return None
|
| 142 |
|
| 143 |
+
live_check_method = "web_enter"
|
| 144 |
js = await self.get_live_info_by_web_enter()
|
| 145 |
if js is None:
|
| 146 |
+
live_check_method = "room_url"
|
| 147 |
js = await self.get_live_info_by_room_url()
|
| 148 |
if js is None:
|
| 149 |
+
live_check_method = "follow"
|
| 150 |
js = await self.get_live_info_by_follow()
|
| 151 |
|
| 152 |
if js is None:
|
|
|
|
| 158 |
stream_data: dict = js["stream_data"]
|
| 159 |
|
| 160 |
if status != 2:
|
| 161 |
+
logger.info(f"{self.flag}{live_check_method}未开播;")
|
| 162 |
return None
|
| 163 |
|
| 164 |
live_url = None
|