diff options
author | morpheus65535 <[email protected]> | 2021-09-21 13:50:49 -0400 |
---|---|---|
committer | morpheus65535 <[email protected]> | 2021-09-21 13:50:49 -0400 |
commit | 6d082f8b388341ce70dfb647efb88b0964651f4b (patch) | |
tree | 6cdbd4186c38deddcb7b346a3dffa5e7dffcb246 | |
parent | 8d698fa7e4972f86c09b6d3fda1c3bb4f5787e8c (diff) | |
download | bazarr-6d082f8b388341ce70dfb647efb88b0964651f4b.tar.gz bazarr-6d082f8b388341ce70dfb647efb88b0964651f4b.zip |
Fixed issue with movies on Addic7ed. #1550v0.9.10-beta.4
-rw-r--r-- | libs/subliminal_patch/providers/addic7ed.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/subliminal_patch/providers/addic7ed.py b/libs/subliminal_patch/providers/addic7ed.py index 2ff04afdf..71f840d9d 100644 --- a/libs/subliminal_patch/providers/addic7ed.py +++ b/libs/subliminal_patch/providers/addic7ed.py @@ -249,8 +249,12 @@ class Addic7edProvider(_Addic7edProvider): for item in movies: link = item.find('a', href=True) if link: - type, media_id = link['href'].split('/') - if type == 'movie': + if link['href'].startswith('movie/'): + splitted_uri = link['href'].split('/') + if len(splitted_uri) == 2: + media_id = splitted_uri[1] + else: + continue media_title = link.text match = re.search(r'(.+)\s\((\d{4})\)$', media_title) if match: @@ -492,7 +496,10 @@ class Addic7edProvider(_Addic7edProvider): page_link = self.server_url + 'movie/' + movie_id version_matches = re.search(r'Version\s(.+),.+', str(row1.contents[1].contents[1])) version = version_matches.group(1) if version_matches else None - download_link = row2.contents[8].contents[2].attrs['href'][1:] + try: + download_link = row2.contents[8].contents[3].attrs['href'][1:] + except IndexError: + download_link = row2.contents[8].contents[2].attrs['href'][1:] uploader = row1.contents[2].contents[8].text.strip() # set subtitle language to hi if it's hearing_impaired |