wangkun пре 2 година
родитељ
комит
539a5ffbb0
1 измењених фајлова са 5 додато и 5 уклоњено
  1. 5 5
      common/common.py

+ 5 - 5
common/common.py

@@ -130,7 +130,7 @@ class Common:
 
             # 下载视频
             urllib3.disable_warnings()
-            response = requests.get(video_url, stream=True, proxies=proxies, verify=False)
+            response = requests.get(video_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
             try:
                 with open(video_path + video_name, "wb") as f:
                     for chunk in response.iter_content(chunk_size=10240):
@@ -148,7 +148,7 @@ class Common:
 
             # 下载视频
             urllib3.disable_warnings()
-            response = requests.get(audio_url, stream=True, proxies=proxies, verify=False)
+            response = requests.get(audio_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
             try:
                 with open(video_path + audio_name, "wb") as f:
                     for chunk in response.iter_content(chunk_size=10240):
@@ -166,7 +166,7 @@ class Common:
 
             # 下载封面
             urllib3.disable_warnings()
-            response = requests.get(cover_url, proxies=proxies, verify=False)
+            response = requests.get(cover_url, proxies=cls.tunnel_proxies(), verify=False)
             try:
                 with open(video_path + cover_name, "wb") as f:
                     f.write(response.content)
@@ -199,7 +199,7 @@ class Common:
 
             # 下载视频
             urllib3.disable_warnings()
-            response = requests.get(video_url, stream=True, proxies=proxies, verify=False)
+            response = requests.get(video_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
             try:
                 with open(video_path + video_name, "wb") as f:
                     for chunk in response.iter_content(chunk_size=10240):
@@ -215,7 +215,7 @@ class Common:
 
             # 下载视频
             urllib3.disable_warnings()
-            response = requests.get(audio_url, stream=True, proxies=proxies, verify=False)
+            response = requests.get(audio_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
             try:
                 with open(video_path + audio_name, "wb") as f:
                     for chunk in response.iter_content(chunk_size=10240):