mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
- Made nova2dl.py more robust by downloading the torrent itself if the search plugin does not provide the download_torrent() method
This commit is contained in:
parent
843168bb62
commit
332a4121c8
1 changed files with 6 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#VERSION: 1.00
|
#VERSION: 1.10
|
||||||
|
|
||||||
# Author:
|
# Author:
|
||||||
# Christophe DUMEZ (chris@qbittorrent.org)
|
# Christophe DUMEZ (chris@qbittorrent.org)
|
||||||
|
@ -33,6 +33,7 @@
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import glob
|
import glob
|
||||||
|
from helpers import download_file
|
||||||
|
|
||||||
supported_engines = dict()
|
supported_engines = dict()
|
||||||
|
|
||||||
|
@ -56,5 +57,8 @@ if __name__ == '__main__':
|
||||||
if engine_url not in supported_engines.keys():
|
if engine_url not in supported_engines.keys():
|
||||||
raise SystemExit('./nova2dl.py: this engine_url was not recognized')
|
raise SystemExit('./nova2dl.py: this engine_url was not recognized')
|
||||||
exec "engine = %s()"%supported_engines[engine_url]
|
exec "engine = %s()"%supported_engines[engine_url]
|
||||||
|
if hasattr(engine, 'download_torrent'):
|
||||||
engine.download_torrent(download_param)
|
engine.download_torrent(download_param)
|
||||||
|
else:
|
||||||
|
print download_file(download_param)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
Loading…
Add table
Add a link
Reference in a new issue