Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
版本更新
Browse files Browse the repository at this point in the history
  • Loading branch information
666wcy committed Mar 13, 2022
1 parent 9de26ce commit 3a8eda8
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 30 deletions.
69 changes: 48 additions & 21 deletions need/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pythoncom
import re
import requests
import os

from urllib.parse import urlparse
#推送aria2单任务
Expand Down Expand Up @@ -77,6 +78,8 @@ def thread_Thunder(file_id):
app_config = json.loads(f.read())
f.close()



if type(file_id)==list:
down_name_list=[]
down_url_list=[]
Expand Down Expand Up @@ -163,6 +166,17 @@ def thread_IDM(file_id,IDM):
jsonFile.close()

app_config = data
if app_config['Download_path'] != "":
the_down_path = f"{app_config['Download_path']}"

if not os.path.exists(the_down_path):
os.makedirs(the_down_path)
else:
parent_path = os.getcwd()
the_down_path = f"{parent_path}/下载"

if not os.path.exists(the_down_path):
os.makedirs(the_down_path)

Popen([IDM])

Expand Down Expand Up @@ -192,7 +206,7 @@ def thread_IDM(file_id,IDM):

print(f"INFO ({new_time}):推送IDM:{down_name}")

Popen([IDM, '/d', down_url, "/p", data['Download_path'], '/f', down_name, '/n', '/a'])
Popen([IDM, '/d', down_url, "/p", the_down_path, '/f', down_name, '/n', '/a'])


new_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
Expand All @@ -212,7 +226,7 @@ def thread_IDM(file_id,IDM):
print(f"INFO ({new_time}):推送IDM:识别为文件夹:{down_name},开始获取目录信息")


for name, url, size, path in get_folder_all_file(folder_id=file_id, path=f"{data['Download_path']}/{down_name}/"):
for name, url, size, path in get_folder_all_file(folder_id=file_id, path=f"{the_down_path}/{down_name}/"):


down_name = f"{name}"
Expand Down Expand Up @@ -259,7 +273,7 @@ def thread_IDM(file_id,IDM):
down_key = re.findall("(.*?)/download.*", down_url, re.S)[0]
down_url = down_url.replace(down_key, str(app_config['download_url_word']))

Popen([IDM, '/d', down_url,"/p",data['Download_path'], '/f', down_name, '/n', '/s'])
Popen([IDM, '/d', down_url,"/p",the_down_path, '/f', down_name, '/n', '/s'])


def thread_pot(file_id,Pot):
Expand Down Expand Up @@ -362,6 +376,9 @@ def thread_aria2(file_id):
# 读取数据并分割。 最后一个为空,所以去除
app_config = json.loads(f.read())
f.close()



if type(file_id) == list:

for a in file_id:
Expand Down Expand Up @@ -437,7 +454,17 @@ def thread_Bitcomet(file_id,thread_url):

app_config = data

if app_config['Download_path'] != "":
the_down_path = f"{app_config['Download_path']}"

if not os.path.exists(the_down_path):
os.makedirs(the_down_path)
else:
parent_path = os.getcwd()
the_down_path = f"{parent_path}/下载"

if not os.path.exists(the_down_path):
os.makedirs(the_down_path)

if type(file_id) == list:
down_name_list = []
Expand Down Expand Up @@ -467,9 +494,9 @@ def thread_Bitcomet(file_id,thread_url):

down_key = re.findall("(.*?)/download.*", down_url, re.S)[0]
domain_key_list = ["https://vod0051-aliyun18-vip-lixian.mypikpak.com",
"https://vod0037-aliyun18-vip-lixian.mypikpak.com",
"https://vod0039-aliyun18-vip-lixian.mypikpak.com",
"https://vod0038-aliyun18-vip-lixian.mypikpak.com",
"https://vod0037-aliyun17-vip-lixian.mypikpak.com",
"https://vod0039-aliyun17-vip-lixian.mypikpak.com",
"https://vod0038-aliyun17-vip-lixian.mypikpak.com",
"https://vod0049-aliyun18-vip-lixian.mypikpak.com",
"https://vod0050-aliyun18-vip-lixian.mypikpak.com",
"https://vod0041-hwyun02-vip-lixian.mypikpak.com",
Expand Down Expand Up @@ -497,15 +524,15 @@ def thread_Bitcomet(file_id,thread_url):
mirror_url = mirror_url + down_url.replace(down_key, a) + "&\n"
postdata = {
"url": f"{down_url}",
"save_path": data['Download_path'],
"save_path": the_down_path,
"connection": "200",
"file_name": down_name,
"referrer": "",
"user_agent": "",
"cookie": "",
"mirror_url_list": mirror_url
}
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result", data=postdata)
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result",data=postdata,proxies=None)

if html.status_code == 502:
print(f"Error ({new_time}):推送Bitcomet失败:url链接不正确")
Expand All @@ -529,7 +556,7 @@ def thread_Bitcomet(file_id,thread_url):
print(f"INFO ({new_time}):推送Bitcomet:识别为文件夹:{down_name},开始获取目录信息")

for name, url, size, path in get_folder_all_file(folder_id=file_id,
path=f"{data['Download_path']}/{down_name}/"):
path=f"{the_down_path}/{down_name}/"):

down_name = f"{name}"
the_filesize = size
Expand Down Expand Up @@ -586,15 +613,15 @@ def thread_Bitcomet(file_id,thread_url):
mirror_url = mirror_url + down_url.replace(down_key, a) + "&\n"
postdata = {
"url": f"{down_url}",
"save_path": data['Download_path'],
"save_path": down_path,
"connection": "200",
"file_name": down_name,
"referrer": "",
"user_agent": "",
"cookie": "",
"mirror_url_list": mirror_url
}
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result", data=postdata)
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result",data=postdata,proxies=None)

if html.status_code == 502:
print(f"Error ({new_time}):推送Bitcomet失败:url链接不正确")
Expand Down Expand Up @@ -657,15 +684,15 @@ def thread_Bitcomet(file_id,thread_url):
mirror_url = mirror_url + down_url.replace(down_key, a) + "&\n"
postdata = {
"url": f"{down_url}",
"save_path": data['Download_path'],
"save_path": the_down_path,
"connection": "200",
"file_name": down_name,
"referrer": "",
"user_agent": "",
"cookie": "",
"mirror_url_list": mirror_url
}
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result",data=postdata)
html = requests.post(url=f"{thread_url}/panel/task_add_httpftp_result",data=postdata,proxies=None)

if html.status_code == 502:
print(f"Error ({new_time}):推送Bitcomet失败:url链接不正确")
Expand Down Expand Up @@ -824,12 +851,12 @@ def run(self):


'''{
"url": "https://vod0050-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C",
"save_path": "C:\\Users\\weicy\\Downloads\\Telegram+Desktop",
"connection": "200",
"file_name": "1.mp4",
"referrer": "",
"user_agent": "",
"cookie": "",
"mirror_url_list": "https://vod0051-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C\r\nhttps://vod0049-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C"
"url": "https://vod0050-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C",
"save_path": "C:\\Users\\weicy\\Downloads\\Telegram+Desktop",
"connection": "200",
"file_name": "1.mp4",
"referrer": "",
"user_agent": "",
"cookie": "",
"mirror_url_list": "https://vod0051-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C\r\nhttps://vod0049-aliyun18-vip-lixian.mypikpak.com/download/?fid=8EjS5VME9cYbtDuEjGR1jTR*tQ63D*k2AAAAAA4OkA0TjTLRQTm**q7CT4pd6men&mid=666&threshold=251&tid=EA093CE26197A2C675AF5F3187FBC387&srcid=0&verno=2&pk=xdrive&e=1646573332&g=0E0E900D138D32D14139BEFAAEC24F8A5DEA67A7&i=F048D2E55304F5C61BB43B848C64758D347EB50E&ui=YRdkHHI8ZU8Ap0ER&t=0&hy=1&ms=6300000&th=0&pt=1&f=921243575&spr=flow&fileid=VMnBPVQjMRShWd-IisrphFm0o1&fext=rar&userid=YRdkHHI8ZU8Ap0ER&clientid=YNxT9w7GMdWvEOKa&projectid=2wks56c31dc80sxm5p9&vip=PVIP&clientver=&at=D9235013033155DEC13D1848EC498E8C"
}'''
4 changes: 2 additions & 2 deletions need/yang.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ def setupUi(self, Form):
self.scrollArea.setWidgetResizable(True)
self.scrollArea.setObjectName("scrollArea")
self.configscrollAreaWidgetContents = QtWidgets.QWidget()
self.configscrollAreaWidgetContents.setGeometry(QtCore.QRect(0, -713, 1245, 1252))
self.configscrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 1013, 1252))
self.configscrollAreaWidgetContents.setObjectName("configscrollAreaWidgetContents")
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.configscrollAreaWidgetContents)
self.verticalLayout_9.setObjectName("verticalLayout_9")
Expand Down Expand Up @@ -1730,7 +1730,7 @@ def setupUi(self, Form):
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "PikPakDown"))
self.titlelabel.setText(_translate("Form", "PikPakDown v2.2.8"))
self.titlelabel.setText(_translate("Form", "PikPakDown v2.2.9"))
self.pingtitlelabel.setText(_translate("Form", "连接情况:"))
self.pinginfo_label.setText(_translate("Form", "检测中"))
self.tohidepushButton.setText(_translate("Form", "-"))
Expand Down
6 changes: 3 additions & 3 deletions need/yang.ui
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ border-bottom:6px ridge #E0E0E0;
</font>
</property>
<property name="text">
<string>PikPakDown v2.2.8</string>
<string>PikPakDown v2.2.9</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1182,8 +1182,8 @@ QScrollBar::add-line:horizontal {
<property name="geometry">
<rect>
<x>0</x>
<y>-713</y>
<width>1245</width>
<y>0</y>
<width>1013</width>
<height>1252</height>
</rect>
</property>
Expand Down
9 changes: 5 additions & 4 deletions pikpakdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def read_config():
from subprocess import Popen
import subprocess

import cgitb



upload_task=[]
Expand Down Expand Up @@ -3067,7 +3067,8 @@ def check_network_back(self,num):

# 退出APP
def start_exit_app(self):
exit()
sys.exit()


# 离线下载界面
def offline_page(self):
Expand Down Expand Up @@ -6015,10 +6016,10 @@ def start_choose_idm(self):
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)

#崩溃错误捕获
log_dir = os.path.join(os.getcwd(), 'log')
'''log_dir = os.path.join(os.getcwd(), 'log')
if not os.path.exists(log_dir):
os.mkdir(log_dir)
cgitb.enable(format='text', logdir=log_dir)
cgitb.enable(format='text', logdir=log_dir)'''


app = QtWidgets.QApplication(sys.argv)
Expand Down

0 comments on commit 3a8eda8

Please sign in to comment.