def check(self):
     is_live = self.get_live_info()
     if is_live:
         video_dict = self.get_hsl(is_live)
         video_dict['Provide'] = self.module
         process_video(video_dict, self.user_config)
     self.logger.info(f'{self.target_id}: Not found Live')
Esempio n. 2
0
 def check(self):
     try:
         html = get(
             f'https://www.youtube.com/channel/{self.target_id}/featured')
         if '"label":"LIVE NOW"' in html:
             # vid = self.get_videoid_by_channel_id()
             # get_live_info = self.getlive_vid(vid)
             retry_num = 0
             while retry_num < 3:
                 video_dict = self.get_video_info_by_html()
                 if video_dict:
                     break
                 else:
                     sleep(0.5)
                     retry_num += 1
             else:
                 video_dict = self.get_videoid_by_channel_id(self.target_id)
             video_dict['Provide'] = self.module
             # 确定视频不重复
             if self.vid != video_dict['Ref']:
                 self.vid = video_dict['Ref']
                 process_video(video_dict)
             else:
                 self.logger.warning('Found A Repeated Video. Drop it')
                 sleep(1)
         else:
             if 'Upcoming live streams' in html:
                 self.logger.info(
                     f'{self.target_id}: Found A Live Upcoming')
             else:
                 self.logger.info(f'{self.target_id}: Not found Live')
     except Exception:
         self.logger.exception('Check Failed')
 def check(self):
     live_info = self.live_info()
     if live_info.get('Is_live'):
         video_dict = self.get_hsl(live_info)
         video_dict['Provide'] = self.module
         process_video(video_dict)
     else:
         self.logger.info(f'{self.target_id}: Not found Live')
 def check(self):
     is_live = self.is_live()
     if is_live:
         video_dict = is_live
         video_dict['Provide'] = self.module
         process_video(video_dict, self.user_config)
     else:
         self.logger.info(f'{self.target_id}: Not found Live')
Esempio n. 5
0
 def check(self):
     self.vinfo = self.get_temp_vid(self.vinfo)
     self.vid = self.vinfo['Vid']
     html = get("https://www.youtube.com/watch?v=" f"{self.vid}")
     if r'"isLive\":true' in html:
         video_dict = self.getlive_title(self.vid)
         process_video(video_dict)
         self.db.delete(self.vinfo)
     else:
         self.logger.info(f'Not found Live')
Esempio n. 6
0
def test_process_video():
    v = VideoUpload()
    v.start()
    live_dict = {'Title': '【歌ってみた】スイートマジック 【夏色まつり×紫咲シオン】',
                 'Ref': '97lcMrPqzHg',
                 'Date': '2019-05-12',
                 'Target': 'https://www.youtube.com/watch?v=97lcMrPqzHg',
                 'Provide': 'Youtube'}
    process_video(live_dict)
    v.join()
Esempio n. 7
0
 def check(self):
     try:
         live_info = self.live_info()
         if live_info.get('Is_live'):
             video_dict = self.get_hsl(live_info)
             video_dict['Provide'] = self.module
             process_video(video_dict, self.user_config)
         else:
             self.logger.info(f'{self.target_id}: Not found Live')
     except Exception:
         self.logger.exception('Check Failed')
Esempio n. 8
0
 def check(self):
     html = get(
         f'https://www.youtube.com/channel/{self.target_id}/featured')
     if '"label":"LIVE NOW"' in html:
         # vid = self.get_videoid_by_channel_id()
         # get_live_info = self.getlive_vid(vid)
         video_dict = self.get_videoid_by_channel_id(self.target_id)
         video_dict['Provide'] = self.module
         process_video(video_dict)
     else:
         if 'Upcoming live streams' in html:
             self.logger.info(f'{self.target_id}: Found A Live Upcoming')
         else:
             self.logger.info(f'{self.target_id}: Not found Live')