diff --git a/CHANGELOG.md b/CHANGELOG.md index 229ac9db5b..ebe1e13f71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Fixed episode lookup with conflicting show IDs ([#4933](https://github.com/pymedusa/Medusa/pull/4933)) - Fixed error getting season scene exceptions on show page [#4964](https://github.com/pymedusa/Medusa/pull/4964) - Fixed testing email notification with TLS ([#4972](https://github.com/pymedusa/Medusa/pull/4972)) +- Fixed provider hd-space parsing pubdate like 'yesterday at 12:00:00' ([#5111](https://github.com/pymedusa/Medusa/pull/5111)) - Fixed apiv2 call hanging, when opening an anime show, that has malformed data on anidb (with anidb enabled) ([#4961](https://github.com/pymedusa/Medusa/pull/4961)) ----- diff --git a/medusa/providers/generic_provider.py b/medusa/providers/generic_provider.py index 5c3cf21431..47ea94b180 100644 --- a/medusa/providers/generic_provider.py +++ b/medusa/providers/generic_provider.py @@ -574,12 +574,25 @@ def parse_pubdate(pubdate, human_time=False, timezone=None, **kwargs): matched_time = int(round(float(matched_time.strip()))) seconds = parse('{0} {1}'.format(matched_time, matched_granularity)) + if seconds is None: + log.warning('Failed parsing human time: {0} {1}', matched_time, matched_granularity) + raise ValueError('Failed parsing human time: {0} {1}'.format(matched_time, matched_granularity)) + return datetime.now(tz.tzlocal()) - timedelta(seconds=seconds) if fromtimestamp: dt = datetime.fromtimestamp(int(pubdate), tz=tz.gettz('UTC')) else: - dt = parser.parse(pubdate, dayfirst=df, yearfirst=yf, fuzzy=True) + day_offset = 0 + if 'yesterday at' in pubdate.lower() or 'today at' in pubdate.lower(): + # Extract a time + time = re.search(r'(?P