mirror of
https://github.com/simon987/nyaa.git
synced 2025-12-16 00:09:05 +00:00
Handle qButtorrent empty url-list/webseeds
url-list is supposed to be omitted in case of no webseeds, but qB will instead use an empty bytestring '' as the value. This commit makes the validation more lenient regarding url-list.
This commit is contained in:
@@ -140,7 +140,8 @@ def handle_torrent_upload(upload_form, uploading_user=None, fromAPI=False):
|
||||
trackers.add(announce[0].decode('ascii'))
|
||||
|
||||
# Store webseeds
|
||||
webseed_list = torrent_data.torrent_dict.get('url-list', [])
|
||||
# qBittorrent doesn't omit url-list but sets it as '' even when there are no webseeds
|
||||
webseed_list = torrent_data.torrent_dict.get('url-list') or []
|
||||
webseeds = OrderedSet(webseed.decode('utf-8') for webseed in webseed_list)
|
||||
|
||||
# Remove our trackers, maybe? TODO ?
|
||||
|
||||
Reference in New Issue
Block a user