|  | @@ -1,6 +1,10 @@
 | 
											
												
													
														|  |  # -*- coding: utf-8 -*-
 |  |  # -*- coding: utf-8 -*-
 | 
											
												
													
														|  |  # @Author: wangkun
 |  |  # @Author: wangkun
 | 
											
												
													
														|  |  # @Time: 2022/9/1
 |  |  # @Time: 2022/9/1
 | 
											
												
													
														|  | 
 |  | +"""
 | 
											
												
													
														|  | 
 |  | +上传视频到阿里云 OSS
 | 
											
												
													
														|  | 
 |  | +上传视频到管理后台
 | 
											
												
													
														|  | 
 |  | +"""
 | 
											
												
													
														|  |  import json
 |  |  import json
 | 
											
												
													
														|  |  import os
 |  |  import os
 | 
											
												
													
														|  |  import random
 |  |  import random
 | 
											
										
											
												
													
														|  | @@ -8,7 +12,6 @@ import time
 | 
											
												
													
														|  |  import oss2
 |  |  import oss2
 | 
											
												
													
														|  |  import requests
 |  |  import requests
 | 
											
												
													
														|  |  import urllib3
 |  |  import urllib3
 | 
											
												
													
														|  | -# from crawler_shipinhao.main.common import Common
 |  | 
 | 
											
												
													
														|  |  from main.common import Common
 |  |  from main.common import Common
 | 
											
												
													
														|  |  proxies = {"http": None, "https": None}
 |  |  proxies = {"http": None, "https": None}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -135,7 +138,7 @@ class Publish:
 | 
											
												
													
														|  |          os.rmdir(local_file)
 |  |          os.rmdir(local_file)
 | 
											
												
													
														|  |          Common.logger(log_type).info("remove local file dir = {} success".format(local_file))
 |  |          Common.logger(log_type).info("remove local file dir = {} success".format(local_file))
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -    local_file_path = './videos/'
 |  | 
 | 
											
												
													
														|  | 
 |  | +    local_file_path = './videos'
 | 
											
												
													
														|  |      video_file = 'video'
 |  |      video_file = 'video'
 | 
											
												
													
														|  |      image_file = 'image'
 |  |      image_file = 'image'
 | 
											
												
													
														|  |      info_file = 'info'
 |  |      info_file = 'info'
 | 
											
										
											
												
													
														|  | @@ -245,6 +248,7 @@ class Publish:
 | 
											
												
													
														|  |                      else:
 |  |                      else:
 | 
											
												
													
														|  |                          video_id = cls.publish_video_dev(log_type, data)
 |  |                          video_id = cls.publish_video_dev(log_type, data)
 | 
											
												
													
														|  |                      cls.remove_local_file_dir(log_type, fi_d)
 |  |                      cls.remove_local_file_dir(log_type, fi_d)
 | 
											
												
													
														|  | 
 |  | +                    Common.logger(log_type).info('video_id:{}', video_id)
 | 
											
												
													
														|  |                      return video_id
 |  |                      return video_id
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |                  else:
 |  |                  else:
 |