Browse Source

- Made nova2dl.py more robust by downloading the torrent itself if the search plugin does not provide the download_torrent() method

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
332a4121c8
  1. 8
      src/search_engine/nova2dl.py

8
src/search_engine/nova2dl.py

@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#VERSION: 1.00
#VERSION: 1.10
# Author:
# Christophe DUMEZ (chris@qbittorrent.org)
@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
import sys
import os
import glob
from helpers import download_file
supported_engines = dict()
@ -56,5 +57,8 @@ if __name__ == '__main__': @@ -56,5 +57,8 @@ if __name__ == '__main__':
if engine_url not in supported_engines.keys():
raise SystemExit('./nova2dl.py: this engine_url was not recognized')
exec "engine = %s()"%supported_engines[engine_url]
engine.download_torrent(download_param)
if hasattr(engine, 'download_torrent'):
engine.download_torrent(download_param)
else:
print download_file(download_param)
sys.exit(0)
Loading…
Cancel
Save