Private GIT

Skip to content
Snippets Groups Projects
Commit 50b81987 authored by Dustyn Gibson's avatar Dustyn Gibson
Browse files

Merge pull request #1858 from nicolasmartinelli/develop-eztv-episode

Add flexibility when determine title from link in eztvapi.re:
parents 093368b2 9623a171
Branches
Tags
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