Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with latest subliminal #3313

Merged
merged 2 commits into from
Nov 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/subliminal/providers/addic7ed.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Addic7edSubtitle(Subtitle):

def __init__(self, language, hearing_impaired, page_link, series, season, episode, title, year, version,
download_link):
super(Addic7edSubtitle, self).__init__(language, hearing_impaired, page_link)
super(Addic7edSubtitle, self).__init__(language, hearing_impaired=hearing_impaired, page_link=page_link)
self.series = series
self.season = season
self.episode = episode
Expand Down
21 changes: 17 additions & 4 deletions ext/subliminal/providers/legendastv.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,13 @@ class LegendasTVProvider(Provider):
subtitle_class = LegendasTVSubtitle

def __init__(self, username=None, password=None):

# Provider needs UNRAR installed. If not available raise ConfigurationError
try:
rarfile.custom_check(rarfile.UNRAR_TOOL)
except rarfile.RarExecError:
raise ConfigurationError('UNRAR tool not available')

if any((username, password)) and not all((username, password)):
raise ConfigurationError('Username and password must be specified')

Expand Down Expand Up @@ -356,10 +363,16 @@ def get_archives(self, title_id, language_code, title_type, season, episode):
# episode
if season and episode:
# discard mismatches on episode in non-pack archives
if not archive.pack and 'episode' in guess and guess['episode'] != episode:
logger.debug('Mismatched episode %s, discarding archive: %s',
guess['episode'], archive.name)
continue

# Guessit may return int for single episode or list for multi-episode
# Check if archive name has multiple episodes releases on it
if not archive.pack and 'episode' in guess:
wanted_episode = set(episode) if isinstance(episode, list) else {episode}
archive_episode = guess['episode'] if isinstance(guess['episode'], list) else {guess['episode']}

if not wanted_episode.intersection(archive_episode):
logger.debug('Mismatched episode %s, discarding archive: %s', guess['episode'], clean_name)
continue

# extract text containing downloads, rating and timestamp
data_text = archive_soup.find('p', class_='data').text
Expand Down
8 changes: 6 additions & 2 deletions ext/subliminal/providers/opensubtitles.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class OpenSubtitlesSubtitle(Subtitle):

def __init__(self, language, hearing_impaired, page_link, subtitle_id, matched_by, movie_kind, hash, movie_name,
movie_release_name, movie_year, movie_imdb_id, series_season, series_episode, filename, encoding):
super(OpenSubtitlesSubtitle, self).__init__(language, hearing_impaired, page_link, encoding)
super(OpenSubtitlesSubtitle, self).__init__(language, hearing_impaired=hearing_impaired,
page_link=page_link, encoding=encoding)
self.subtitle_id = subtitle_id
self.matched_by = matched_by
self.movie_kind = movie_kind
Expand Down Expand Up @@ -158,7 +159,10 @@ def query(self, languages, hash=None, size=None, imdb_id=None, query=None, seaso
if hash and size:
criteria.append({'moviehash': hash, 'moviebytesize': str(size)})
if imdb_id:
criteria.append({'imdbid': imdb_id[2:]})
if season and episode:
criteria.append({'imdbid': imdb_id[2:], 'season': season, 'episode': episode})
else:
criteria.append({'imdbid': imdb_id[2:]})
if tag:
criteria.append({'tag': tag})
if query and season and episode:
Expand Down
2 changes: 1 addition & 1 deletion ext/subliminal/providers/podnapisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PodnapisiSubtitle(Subtitle):

def __init__(self, language, hearing_impaired, page_link, pid, releases, title, season=None, episode=None,
year=None):
super(PodnapisiSubtitle, self).__init__(language, hearing_impaired, page_link)
super(PodnapisiSubtitle, self).__init__(language, hearing_impaired=hearing_impaired, page_link=page_link)
self.pid = pid
self.releases = releases
self.title = title
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ python-dateutil==2.6.1
requests==2.18.4
SQLAlchemy==1.1.14
stevedore==1.26.0
git+https://github.com/Diaoul/subliminal.git@425781d123cfafddc7967b8b09a3d9fe73267d8b#egg=subliminal
git+https://github.com/Diaoul/subliminal.git@56c761f4778b74e76532dc5f517160e09a792044#egg=subliminal
tornado==4.5.2
tornroutes==0.5.1
validators==0.12.0
Expand Down