Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
196 changes: 98 additions & 98 deletions QuickCut/QuickCut.py
Original file line number Diff line number Diff line change
Expand Up @@ -2395,86 +2395,86 @@ def initGui(self):
self.userDownloadPath = self.userPath + '/Downloads'
self.userDesktopPath = self.userPath + '/Desktop'

# annie
# lux
if True:
self.annieGroup = QGroupBox(self.tr('使用 Annie 下载视频'))
self.annieLayout = QVBoxLayout()
self.annieGroup.setLayout(self.annieLayout)
self.masterLayout.addWidget(self.annieGroup)

self.annieInputLinkHint = QLabel(self.tr('视频链接:'))
self.annieInputBox = QLineEdit()
self.annieSavePathHint = QLabel(self.tr('保存路径:'))
self.annieSaveBox = QComboBox()
self.annieSaveBox.setEditable(True)
self.annieSaveBox.addItems(
self.luxGroup = QGroupBox(self.tr('使用 lux 下载视频'))
self.luxLayout = QVBoxLayout()
self.luxGroup.setLayout(self.luxLayout)
self.masterLayout.addWidget(self.luxGroup)

self.luxInputLinkHint = QLabel(self.tr('视频链接:'))
self.luxInputBox = QLineEdit()
self.luxSavePathHint = QLabel(self.tr('保存路径:'))
self.luxSaveBox = QComboBox()
self.luxSaveBox.setEditable(True)
self.luxSaveBox.addItems(
[self.userPath, self.userVideoPath, self.userDownloadPath, self.userDesktopPath])

self.annieDownloadFormatHint = QLabel(self.tr('下载格式(流id):'))
self.annieDownloadFormatBox = QLineEdit()
self.annieDownloadFormatBox.setPlaceholderText(self.tr('不填则默认下载最高画质'))
self.annieDownloadFormatBox.setAlignment(Qt.AlignCenter)

self.annieCookiesHint = QLabel('Cookies')
self.annieCookiesBox = MyQLine()
self.annieCookiesBox.setPlaceholderText(self.tr('默认不用填'))
self.annieCookiesButton = QPushButton(self.tr('选择文件'))
self.annieCookiesButton.clicked.connect(self.annieCookiesButtonClicked)

self.annieProxyHint = QLabel(self.tr('代理:'))
self.annieProxyBox = QComboBox()
self.annieProxyBox.setEditable(True)
self.annieProxyBox.addItems(
self.luxDownloadFormatHint = QLabel(self.tr('下载格式(流id):'))
self.luxDownloadFormatBox = QLineEdit()
self.luxDownloadFormatBox.setPlaceholderText(self.tr('不填则默认下载最高画质'))
self.luxDownloadFormatBox.setAlignment(Qt.AlignCenter)

self.luxCookiesHint = QLabel('Cookies')
self.luxCookiesBox = MyQLine()
self.luxCookiesBox.setPlaceholderText(self.tr('默认不用填'))
self.luxCookiesButton = QPushButton(self.tr('选择文件'))
self.luxCookiesButton.clicked.connect(self.luxCookiesButtonClicked)

self.luxProxyHint = QLabel(self.tr('代理:'))
self.luxProxyBox = QComboBox()
self.luxProxyBox.setEditable(True)
self.luxProxyBox.addItems(
['', 'http://127.0.0.1:5000/', 'socks5://127.0.0.1:5000/'])

self.anniePlayListBox = QCheckBox(self.tr('下载视频列表'))

self.annieCheckInfoButton = QPushButton(self.tr('列出流id'))
# self.annieCheckInfoButton.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
self.annieCheckInfoButton.clicked.connect(self.annieCheckInfoButtonClicked)
self.annieDownloadButton = QPushButton(self.tr('开始下载视频'))
self.annieDownloadButton.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
self.annieDownloadButton.clicked.connect(self.annieDownloadButtonClicked)

self.annieInputLinkWidgetLayout = QHBoxLayout() # 输入链接
self.annieInputLinkWidgetLayout.addWidget(self.annieInputBox, 2)
self.annieInputLinkWidgetLayout.addWidget(self.anniePlayListBox, 1)
self.annieInputLinkWidgetLayout.setContentsMargins(0,0,0,0)
self.annieInputLinkWidget = QWidget()
self.annieInputLinkWidget.setLayout(self.annieInputLinkWidgetLayout)
self.annieInputLinkWidget.setContentsMargins(0,0,0,0)

self.annieStreamIdWidgetLayout = QHBoxLayout() # 流 id
self.annieStreamIdWidgetLayout.addWidget(self.annieDownloadFormatBox, 2)
self.annieStreamIdWidgetLayout.addWidget(self.annieCheckInfoButton, 1)
self.annieStreamIdWidgetLayout.setContentsMargins(0, 0, 0, 0)
self.annieStreamIdWidget = QWidget()
self.annieStreamIdWidget.setLayout(self.annieStreamIdWidgetLayout)
self.annieStreamIdWidget.setContentsMargins(0, 0, 0, 0)

self.annieCookiesWidgetLayout = QHBoxLayout() # cookies
self.annieCookiesWidgetLayout.addWidget(self.annieCookiesBox, 2)
self.annieCookiesWidgetLayout.addWidget(self.annieCookiesButton, 1)
self.annieCookiesWidgetLayout.setContentsMargins(0, 0, 0, 0)
self.annieCookiesWidget = QWidget()
self.annieCookiesWidget.setLayout(self.annieCookiesWidgetLayout)
self.annieCookiesWidget.setContentsMargins(0, 0, 0, 0)


self.annieFormLayout = QFormLayout()
self.annieFormLayout.addRow(self.annieInputLinkHint, self.annieInputLinkWidget)
self.annieFormLayout.addRow(self.annieSavePathHint, self.annieSaveBox)
self.annieFormLayout.addRow(self.annieDownloadFormatHint, self.annieStreamIdWidget)
self.annieFormLayout.addRow(self.annieCookiesHint, self.annieCookiesWidget)
self.annieFormLayout.addRow(self.annieProxyHint, self.annieProxyBox)

self.annieHboxLayout = QHBoxLayout()
self.annieHboxLayout.setContentsMargins(0, 0, 0, 0)
self.annieHboxLayout.addLayout(self.annieFormLayout, 3)
self.annieHboxLayout.addWidget(self.annieDownloadButton, 0)

self.annieLayout.addLayout(self.annieHboxLayout)# 在主垂直布局添加选项的表单布局
self.annieLayout.addStretch(1)
self.luxPlayListBox = QCheckBox(self.tr('下载视频列表'))

self.luxCheckInfoButton = QPushButton(self.tr('列出流id'))
# self.luxCheckInfoButton.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
self.luxCheckInfoButton.clicked.connect(self.luxCheckInfoButtonClicked)
self.luxDownloadButton = QPushButton(self.tr('开始下载视频'))
self.luxDownloadButton.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
self.luxDownloadButton.clicked.connect(self.luxDownloadButtonClicked)

self.luxInputLinkWidgetLayout = QHBoxLayout() # 输入链接
self.luxInputLinkWidgetLayout.addWidget(self.luxInputBox, 2)
self.luxInputLinkWidgetLayout.addWidget(self.luxPlayListBox, 1)
self.luxInputLinkWidgetLayout.setContentsMargins(0,0,0,0)
self.luxInputLinkWidget = QWidget()
self.luxInputLinkWidget.setLayout(self.luxInputLinkWidgetLayout)
self.luxInputLinkWidget.setContentsMargins(0,0,0,0)

self.luxStreamIdWidgetLayout = QHBoxLayout() # 流 id
self.luxStreamIdWidgetLayout.addWidget(self.luxDownloadFormatBox, 2)
self.luxStreamIdWidgetLayout.addWidget(self.luxCheckInfoButton, 1)
self.luxStreamIdWidgetLayout.setContentsMargins(0, 0, 0, 0)
self.luxStreamIdWidget = QWidget()
self.luxStreamIdWidget.setLayout(self.luxStreamIdWidgetLayout)
self.luxStreamIdWidget.setContentsMargins(0, 0, 0, 0)

self.luxCookiesWidgetLayout = QHBoxLayout() # cookies
self.luxCookiesWidgetLayout.addWidget(self.luxCookiesBox, 2)
self.luxCookiesWidgetLayout.addWidget(self.luxCookiesButton, 1)
self.luxCookiesWidgetLayout.setContentsMargins(0, 0, 0, 0)
self.luxCookiesWidget = QWidget()
self.luxCookiesWidget.setLayout(self.luxCookiesWidgetLayout)
self.luxCookiesWidget.setContentsMargins(0, 0, 0, 0)


self.luxFormLayout = QFormLayout()
self.luxFormLayout.addRow(self.luxInputLinkHint, self.luxInputLinkWidget)
self.luxFormLayout.addRow(self.luxSavePathHint, self.luxSaveBox)
self.luxFormLayout.addRow(self.luxDownloadFormatHint, self.luxStreamIdWidget)
self.luxFormLayout.addRow(self.luxCookiesHint, self.luxCookiesWidget)
self.luxFormLayout.addRow(self.luxProxyHint, self.luxProxyBox)

self.luxHboxLayout = QHBoxLayout()
self.luxHboxLayout.setContentsMargins(0, 0, 0, 0)
self.luxHboxLayout.addLayout(self.luxFormLayout, 3)
self.luxHboxLayout.addWidget(self.luxDownloadButton, 0)

self.luxLayout.addLayout(self.luxHboxLayout)# 在主垂直布局添加选项的表单布局
self.luxLayout.addStretch(1)


self.masterLayout.addSpacing(5)
Expand Down Expand Up @@ -2651,10 +2651,10 @@ def initGui(self):
self.youTubeDlLayout.addStretch(1)


def annieCookiesButtonClicked(self):
def luxCookiesButtonClicked(self):
filename = QFileDialog().getOpenFileName(self, self.tr('打开文件'), None, self.tr('所有文件(*)'))
if filename[0] != '':
self.annieCookiesBox.setText(filename[0])
self.luxCookiesBox.setText(filename[0])
return True

def youGetCookiesButtonClicked(self):
Expand All @@ -2669,18 +2669,18 @@ def youtubeDlCookiesButtonClicked(self):
self.youTubeDlCookiesBox.setText(filename[0])
return True

def annieCheckInfoButtonClicked(self):
def luxCheckInfoButtonClicked(self):
try:
os.environ.pop('HTTP_PROXY')
except:
pass
if self.annieInputBox.text != '':
finalCommand = '''annie'''
if self.annieCookiesBox.text() != '':
finalCommand += ''' -c %s''' % self.annieCookiesBox.text()
if self.annieProxyBox.currentText() != '':
os.environ.update(dict({'HTTP_PROXY':self.annieProxyBox.currentText()}))
finalCommand += ''' -i %s''' % self.annieInputBox.text()
if self.luxInputBox.text != '':
finalCommand = '''lux'''
if self.luxCookiesBox.text() != '':
finalCommand += ''' -c %s''' % self.luxCookiesBox.text()
if self.luxProxyBox.currentText() != '':
os.environ.update(dict({'HTTP_PROXY':self.luxProxyBox.currentText()}))
finalCommand += ''' -i %s''' % self.luxInputBox.text()
thread = CommandThread()
thread.command = finalCommand
window = Console(mainWindow)
Expand Down Expand Up @@ -2730,24 +2730,24 @@ def youTubeDlCheckInfoButtonClicked(self):
thread.signalForFFmpeg.connect(outputForFFmpeg.print)
thread.start()

def annieDownloadButtonClicked(self):
def luxDownloadButtonClicked(self):
try:
os.environ.pop('HTTP_PROXY')
except:
pass
if self.annieInputBox.text != '':
finalCommand = '''annie -C'''
if self.annieSaveBox.currentText() != '':
finalCommand += ''' -o "%s"''' % self.annieSaveBox.currentText()
if self.annieDownloadFormatBox.text() != '':
finalCommand += ''' -f %s''' % self.annieDownloadFormatBox.text()
if self.annieCookiesBox.text() != '':
finalCommand += ''' -c "%s"''' % self.annieCookiesBox.text()
if self.annieProxyBox.currentText() != '':
os.environ.update(dict({'HTTP_PROXY':self.annieProxyBox.currentText()}))
if self.anniePlayListBox.isChecked() != False:
if self.luxInputBox.text != '':
finalCommand = '''lux -C'''
if self.luxSaveBox.currentText() != '':
finalCommand += ''' -o "%s"''' % self.luxSaveBox.currentText()
if self.luxDownloadFormatBox.text() != '':
finalCommand += ''' -f %s''' % self.luxDownloadFormatBox.text()
if self.luxCookiesBox.text() != '':
finalCommand += ''' -c "%s"''' % self.luxCookiesBox.text()
if self.luxProxyBox.currentText() != '':
os.environ.update(dict({'HTTP_PROXY':self.luxProxyBox.currentText()}))
if self.luxPlayListBox.isChecked() != False:
finalCommand += ''' -p'''
finalCommand += ''' %s''' % self.annieInputBox.text()
finalCommand += ''' %s''' % self.luxInputBox.text()
thread = CommandThread()
thread.command = finalCommand
window = Console(mainWindow)
Expand Down
4 changes: 2 additions & 2 deletions QuickCut/languages/en.qph
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ Do you want to overwrite?</target>
<target>Optional</target>
</phrase>
<phrase>
<source>使用 Annie 下载视频:</source>
<target>Download videos using Annie: </target>
<source>使用 Lux 下载视频:</source>
<target>Download videos using Lux: </target>
</phrase>
<phrase>
<source>使用 You-Get 下载视频:</source>
Expand Down
4 changes: 2 additions & 2 deletions QuickCut/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ Do you want to overwrite?</translation>
<name>DownLoadVideoTab</name>
<message>
<location filename="../QuickCut.py" line="2370"/>
<source>使用 Annie 下载视频:</source>
<translation>Download videos using Annie: </translation>
<source>使用 Lux 下载视频:</source>
<translation>Download videos using Lux: </translation>
</message>
<message>
<location filename="../QuickCut.py" line="2555"/>
Expand Down
4 changes: 2 additions & 2 deletions QuickCut/misc/README_en.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ pyinstaller -wy -i icon.icns QuickCut.py # 为了图标格式兼容,Mac 用户

### 编译后打包后要做的事

编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 `README.md` 导出成 `README.html` ,同 `icon.ico`、`sponsor.jpg`、`languages` 一起放入编译根目录(Mac 用户放 `icon.icns`),再下载对应系统的 [annie](https://github.com/iawia002/annie/releases) 放入编译根目录。
编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 `README.md` 导出成 `README.html` ,同 `icon.ico`、`sponsor.jpg`、`languages` 一起放入编译根目录(Mac 用户放 `icon.icns`),再下载对应系统的 [lux](https://github.com/iawia002/lux/releases) 放入编译根目录。

如果是 Mac 、Linux 打包的,那一定要给编译目录下的可执行文件用 `chmod +x` 授予可执行权限!

Expand Down
2 changes: 1 addition & 1 deletion README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ pyinstaller --hidden-import pkg_resources.py2_warn --noconfirm -w -i icon.icns Q

### 编译后打包后要做的事

编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 README.md 导出成 README.html ,同 icon.ico、sponsor.jpg 一起放入编译根目录,再下载对应系统的 [annie](https://github.com/iawia002/annie/releases) 放入编译根目录。
编译完成后,还有几个事要做,首先,下载对应系统的 [ffmpeg 和 ffprobe](http://ffmpeg.org/download.html) 放到编译根目录,再把本 README.md 导出成 README.html ,同 icon.ico、sponsor.jpg 一起放入编译根目录,再下载对应系统的 [lux](https://github.com/iawia002/lux/releases) 放入编译根目录。

如果是 Mac 、Linux 打包的,那一定要给编译目录下的可执行文件用 `chmod +x` 授予可执行权限!

Expand Down