Subdownloader 不再工作

Subdownloader 不再工作

它曾经是一个很棒的应用程序,但对我来说,至少在过去的几个月里它没有发挥作用。

我可以搜索字幕,但当我尝试下载字幕时,它总是显示消息Unable to download subtitle <subtitle_name>。我检查了文件下载到的文件夹.gz,它不是一个有效的存档。此错误/警告消息转储到控制台-

(python:21104): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed

(python:21104): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed

(python:21104): Gtk-CRITICAL **: IA__gtk_progress_configure: assertion 'value >= min && value <= max' failed
Traceback (most recent call last):
  File "/usr/share/subdownloader/gui/main.py", line 1126, in onButtonDownload
    osHttpRequests.download('http://www.opensubtitles.org/en/download/file/%s.gz' %sub.getIdFileOnline(), destinationPath)
  File "/usr/share/subdownloader/modules/OSHttpRequests.py", line 72, in download
    self.unpack_subtitle(gz_path, local_path)
  File "/usr/share/subdownloader/modules/OSHttpRequests.py", line 51, in unpack_subtitle
    fileContent = fileObj.readlines();
  File "/usr/lib/python2.7/gzip.py", line 455, in readline
    c = self.read(readsize)
  File "/usr/lib/python2.7/gzip.py", line 261, in read
    self._read(readsize)
  File "/usr/lib/python2.7/gzip.py", line 296, in _read
    self._read_gzip_header()
  File "/usr/lib/python2.7/gzip.py", line 190, in _read_gzip_header
    raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file

如果这个问题无法解决,有人可以建议一种可以批量下载字幕的替代方法吗,例如针对文件夹中的所有视频?

答案1

https://bugs.launchpad.net/subdownloader/+bug/790753我有一个解决方案:

在文件中/usr/share/subdownloader/gui/main.py:注释第 1143 行,取消注释接下来的四行。

修补:

--- /usr/share/subdownloader/gui/main.py.orig   2016-01-15 20:04:50.880252934 +0100
+++ /usr/share/subdownloader/gui/main.py    2016-01-15 20:05:04.380514034 +0100
@@ -1140,11 +1140,11 @@
                    if not skip_all:
                         log.debug("Downloading subtitle '%s'" % destinationPath)
            #print {sub.getIdFileOnline():destinationPath}
-                        osHttpRequests.download('http://www.opensubtitles.org/en/download/file/%s.gz' %sub.getIdFileOnline(), destinationPath)
-                        #if self.OSDBServer.DownloadSubtitles({sub.getIdFileOnline():destinationPath}):
-                            #success_downloaded += 1
-                        #else:
-                            #QMessageBox.about(self.window,_("Error"),_("Unable to download subtitle %s") %sub.getFileName())
+                        #osHttpRequests.download('http://www.opensubtitles.org/en/download/file/%s.gz' %sub.getIdFileOnline(), destinationPath)
+                        if self.OSDBServer.DownloadSubtitles({sub.getIdFileOnline():destinationPath}):
+                            success_downloaded += 1
+                        else:
+                            QMessageBox.about(self.window,_("Error"),_("Unable to download subtitle %s") %sub.getFileName())
                 except Exception, e:
                     traceback.print_exc(e)
                     QMessageBox.about(self.window,_("Error"),_("Unable to download subtitle %s") % sub.getFileName())

相关内容