QQ旋风有离线下载的功能,迅雷离线下载我还要付费,所以选择用QQ离线下载,需要速度快的用迅雷,经常在这两个下载工具间切换,有些地址是它们自有的,索性写个小程序转换下,功能简单,没做什么容错处理
- #-*- coding:utf-8 -*-
-
import sys
-
import base64
-
from PyQt4 import QtCore,QtGui
-
-
class MyWindow(QtGui.QWidget):
-
def __init__(self):
-
QtGui.QWidget.__init__(self)
-
self.setWindowTitle(u'专用下载地址解码')
-
#self.resize(300,200)
-
self.setFixedSize(300,200)
-
vbox=QtGui.QVBoxLayout()
-
self.inputbox=QtGui.QTextEdit()
-
vbox.addWidget(self.inputbox)
-
hbox=QtGui.QHBoxLayout()
-
self.decodebtn=QtGui.QPushButton(u'迅雷链接转换网址')
-
self.connect(self.decodebtn, QtCore.SIGNAL('clicked()'),self.OnThunderDecode)
-
hbox.addWidget(self.decodebtn)
-
self.codebtn=QtGui.QPushButton(u'旋风链接转换网址')
-
self.connect(self.codebtn,QtCore.SIGNAL('clicked()'),self.OnTencentCode)
-
hbox.addWidget(self.codebtn)
-
vbox.addLayout(hbox)
-
self.outputbox=QtGui.QTextEdit()
-
vbox.addWidget(self.outputbox)
-
self.setLayout(vbox)
-
-
def OnThunderDecode(self):
-
thunderurl=self.inputbox.toPlainText()
-
url=thunderurl.split('://')
-
realurl=base64.decodestring(url[1])
-
realurl=realurl[2:-2]
-
self.outputbox.setText(unicode(realurl,'cp936'))
-
-
def OnTencentCode(self):
-
qurl=self.inputbox.toPlainText()
-
url=qurl.split('://')
-
self.outputbox.setText(unicode(base64.decodestring(url[1]),'cp936'))
-
-
-
-
-
-
if __name__=='__main__':
-
app=QtGui.QApplication(sys.argv)
-
window=MyWindow()
-
window.show()
-
app.exec_()
阅读(2498) | 评论(0) | 转发(0) |