Skip to content

Commit

Permalink
Merge pull request #7 from h3llrais3r/hotfix_1.0.1
Browse files Browse the repository at this point in the history
Hotfix 1.0.1
  • Loading branch information
h3llrais3r committed May 13, 2015
2 parents f79c8ed + 8b9f343 commit 2fccff8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion autosubliminal/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
RELEASE_VERSION = '1.0.0'
RELEASE_VERSION = '1.0.1'
CONFIG_VERSION = 4
DB_VERSION = 5
7 changes: 7 additions & 0 deletions changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
</head>
<body>
<div class="master_changelog">
<div class="release">
<div class="version">1.0.1</div>
<div class="releasedate">07-05-2015</div>
<ul class="changelog">
<li class="change">Updated subliminal to my latest master-autosubliminal with fixes for addic7ed and podnapisi providers.</li>
</ul>
</div>
<div class="release">
<div class="version">1.0.0</div>
<div class="releasedate">07-10-2014</div>
Expand Down
2 changes: 2 additions & 0 deletions lib/subliminal/providers/addic7ed.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def compute_matches(self, video):
matches |= compute_guess_properties_matches(video, self.version, 'screenSize')
# guess format
matches |= compute_guess_properties_matches(video, self.version, 'format')
# guess video codec
matches |= compute_guess_properties_matches(video, self.version, 'videoCodec')
return matches


Expand Down
20 changes: 8 additions & 12 deletions lib/subliminal/providers/podnapisi.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def compute_matches(self, video):
class PodnapisiProvider(Provider):
languages = {babelfish.Language.frompodnapisi(l) for l in babelfish.language_converters['podnapisi'].codes}
video_types = (Episode, Movie)
server = 'http://simple.podnapisi.net'
link_re = re.compile('^.*(?P<link>/ppodnapisi/predownload/i/\d+/k/.*$)')
search_url = 'http://simple.podnapisi.net/ppodnapisi/search'
download_url_suffix = '/download'

def initialize(self):
self.session = requests.Session()
Expand All @@ -81,14 +81,14 @@ def terminate(self):
def get(self, url, params=None, is_xml=True):
"""Make a GET request on `url` with the given parameters
:param string url: part of the URL to reach with the leading slash
:param string url: the URL to reach
:param dict params: params of the request
:param bool xml: whether the response content is XML or not
:param bool is_xml: whether the response content is XML or not
:return: the response
:rtype: :class:`xml.etree.ElementTree.Element` or :class:`bs4.BeautifulSoup`
"""
r = self.session.get(self.server + '/ppodnapisi' + url, params=params, timeout=10)
r = self.session.get(url, params=params, timeout=10)
if r.status_code != 200:
raise ProviderError('Request failed with status code %d' % r.status_code)
if is_xml:
Expand All @@ -111,7 +111,7 @@ def query(self, language, series=None, season=None, episode=None, title=None, ye
logger.debug('Searching episode %r', params)
subtitles = []
while True:
root = self.get('/search', params)
root = self.get(self.search_url, params)
if not int(root.find('pagination/results').text):
logger.debug('No subtitle found')
break
Expand Down Expand Up @@ -141,12 +141,8 @@ def list_subtitles(self, video, languages):
return [s for l in languages for s in self.query(l, title=video.title, year=video.year)]

def download_subtitle(self, subtitle):
soup = self.get(subtitle.page_link[38:], is_xml=False)
link = soup.find('a', href=self.link_re)
if not link:
raise ProviderError('Cannot find the download link')
download_url = self.link_re.match(link['href']).group('link').replace('/predownload/', '/download/')
r = self.session.get(self.server + download_url, timeout=10)
download_url = subtitle.page_link + self.download_url_suffix
r = self.session.get(download_url, timeout=10)
if r.status_code != 200:
raise ProviderError('Request failed with status code %d' % r.status_code)
with zipfile.ZipFile(io.BytesIO(r.content)) as zf:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


setup(name='Auto-Subliminal',
version='1.0.0',
version='1.0.1',
license='GPL v3',
description='Auto-Subliminal, the automated subliminal subtitle downloader',
long_description=open('README.md').read(),
Expand Down

0 comments on commit 2fccff8

Please sign in to comment.