Private GIT

Skip to content
Snippets Groups Projects
Commit 9623a171 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

Add flexibility when determine title from link in eztvapi.re:

    1) try magnet link
    2) try rarbg link
    3) try extratorrent link
    4) try '([^/]+$)' : everything after last slash character (not accurate)
    5) fallback, title is equal to link
Sanitizes the title.
Fixes https://github.com/SiCKRAGETV/sickrage-issues/issues/1437
parent 093368b2
No related branches found
No related tags found
No related merge requests found
...@@ -143,12 +143,27 @@ class EZTVProvider(generic.TorrentProvider): ...@@ -143,12 +143,27 @@ class EZTVProvider(generic.TorrentProvider):
for quality in episode['torrents'].keys(): for quality in episode['torrents'].keys():
link = episode['torrents'][quality]['url'] link = episode['torrents'][quality]['url']
getTitle = re.search('&dn=(.*?)&', link) if not re.match('magnet', link) and not re.match('http', link):
if getTitle:
title = getTitle.group(1)
else:
continue continue
# Get title from link:
# 1) try magnet link
# 2) try rarbg link
# 3) try extratorrent link
# 4) try '([^/]+$)' : everything after last slash character (not accurate)
# 5) fallback, title is equal to link
if re.match('.*&dn=(.*?)&', link):
title = re.match('.*&dn=(.*?)&', link).group(1)
elif re.match('http://rarbg.to', link):
title = re.search('([^=]+$)', link).group(0)
elif re.match('http://extratorrent.cc', link):
title = re.search('([^/]+$)', link).group(0)
elif re.search('([^/]+$)', link):
title = re.search('([^/]+$)', link).group(0)
else:
title = link
title = title.replace('+', '.').replace('%20', '.').replace('%5B', '[').replace('%5D', ']')
item = { item = {
'title': title, 'title': title,
'link': link, 'link': link,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment