Skip to content

Commit

Permalink
Fix parsing release group in Animebytes results (#11648) (#11649)
Browse files Browse the repository at this point in the history
* Fix parsing release group in Animebytes results (#11648)

* Fix parsing release group in Animebytes results (#11648)

* Fix parsing release group in Animebytes results (#11648)

* Fix parsing release group in Animebytes results (#11648)

* Use single quotes

---------

Co-authored-by: Dario <[email protected]>
  • Loading branch information
k0mmsussert0d and medariox authored Mar 17, 2024
1 parent 006f3e7 commit 70f9e90
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions medusa/providers/torrent/json/animebytes.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,14 @@ def is_season_exception(series_name):
{'properties': properties_string, 'error': error})
continue

last_field = re.match(r'(.*)\((.*)\)', properties[-1])

# subs = last_field.group(1) if last_field else ''
release_group = '-{0}'.format(last_field.group(2)) if last_field else ''
# the release group could be found in the last segment for finished series
# or in the penultimate segment for ongoing series
release_group = ''
for i in [-1, -2]:
last_field = re.match(r'(.*)\((.*)\)', properties[i])
if last_field:
release_group = '-{0}'.format(last_field.group(2))
break

release_type = OTHER
season = None
Expand Down

0 comments on commit 70f9e90

Please sign in to comment.