wiserain / docker-flexget

Docker image for running Flexget
https://hub.docker.com/r/wiserain/flexget
68 stars 40 forks source link

write_magnet uncaught exception cash the task #64

Closed Arturoe1 closed 2 years ago

Arturoe1 commented 2 years ago

Sometimes the write_magnet causes this error:

2022-08-20 19:10:45 CRITICAL task task1 BUG: Unhandled error in plugin write_magnet: invalid info-hash File "/config/plugins/write_magnet.py", line 66, in magnet_to_torrent params = lt.parse_magnet_uri(magnet_uri) │ │ └ 'magnet:?xt=urn:magnet_uri.. │ └ <Boost.Python.function object at 0x7f51e8595580> └ <module 'libtorrent' from '/usr/lib/python3.9/site-packages/libtorrent.cpython-39-x86_64-linux-musl.so'>

I think it is missing a try-catch enclosure and error handling. Something like this works for me: Line 65

    try:
        params = lt.parse_magnet_uri(magnet_uri)
    except Exception as e:
        raise plugin.PluginError('Failed to parse the uri: {}', str(e))

If there is any error in the parsing it will inform and stop that torrent but not crash the process.