qgyd2021 commited on
Commit
330cb3a
·
1 Parent(s): 31f33fb
toolbox/porter/tasks/douyin_live_record_task.py CHANGED
@@ -205,13 +205,13 @@ class DouyinLiveRecordTask(BaseTask):
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,7 +225,7 @@ class DouyinLiveRecordTask(BaseTask):
225
  metadata.pop("stream_data")
226
 
227
  if status != 2:
228
- logger.info(f"{self.flag}{live_check_method}未开播;")
229
  return None
230
 
231
  # 会员直播
 
205
  async def do_task(self):
206
  room_url = f"https://live.douyin.com/{self.room_id}"
207
 
208
+ live_check_method = "by_web_enter"
209
  js = await self.get_live_info_by_web_enter()
210
  if js is None:
211
+ live_check_method = "by_room_url"
212
  js = await self.get_live_info_by_room_url()
213
  if js is None:
214
+ live_check_method = "by_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,13 +140,13 @@ class DouyinLiveToBilibiliLiveTask(BaseTask):
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,7 +158,7 @@ class DouyinLiveToBilibiliLiveTask(BaseTask):
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
 
140
  if self.is_streaming:
141
  return None
142
 
143
+ live_check_method = "by_web_enter"
144
  js = await self.get_live_info_by_web_enter()
145
  if js is None:
146
+ live_check_method = "by_room_url"
147
  js = await self.get_live_info_by_room_url()
148
  if js is None:
149
+ live_check_method = "by_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