|
@@ -13,6 +13,7 @@ import requests
|
|
|
import ffmpeg
|
|
|
import urllib3
|
|
|
import subprocess
|
|
|
+proxies = {"http": None, "https": None}
|
|
|
|
|
|
|
|
|
class Common:
|
|
@@ -130,7 +131,8 @@ class Common:
|
|
|
|
|
|
# 下载视频
|
|
|
urllib3.disable_warnings()
|
|
|
- response = requests.get(video_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ # response = requests.get(video_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ response = requests.get(video_url, stream=True, proxies=proxies, verify=False)
|
|
|
try:
|
|
|
with open(video_path + video_name, "wb") as f:
|
|
|
for chunk in response.iter_content(chunk_size=10240):
|
|
@@ -148,7 +150,8 @@ class Common:
|
|
|
|
|
|
# 下载视频
|
|
|
urllib3.disable_warnings()
|
|
|
- response = requests.get(audio_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ # response = requests.get(audio_url, stream=True, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ response = requests.get(audio_url, stream=True, proxies=proxies, verify=False)
|
|
|
try:
|
|
|
with open(video_path + audio_name, "wb") as f:
|
|
|
for chunk in response.iter_content(chunk_size=10240):
|
|
@@ -166,7 +169,8 @@ class Common:
|
|
|
|
|
|
# 下载封面
|
|
|
urllib3.disable_warnings()
|
|
|
- response = requests.get(cover_url, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ # response = requests.get(cover_url, proxies=cls.tunnel_proxies(), verify=False)
|
|
|
+ response = requests.get(cover_url, proxies=proxies, verify=False)
|
|
|
try:
|
|
|
with open(video_path + cover_name, "wb") as f:
|
|
|
f.write(response.content)
|