mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
Merge pull request #5454 from CHANTXU64/v2
This commit is contained in:
@@ -382,7 +382,10 @@ class RssHelper:
|
|||||||
size = int(size_attr)
|
size = int(size_attr)
|
||||||
|
|
||||||
# 发布日期
|
# 发布日期
|
||||||
pubdate_nodes = item.xpath('.//pubDate | .//published | .//updated')
|
pubdate_nodes = item.xpath('./pubDate | ./published | ./updated')
|
||||||
|
if not pubdate_nodes:
|
||||||
|
pubdate_nodes = item.xpath('.//*[local-name()="pubDate"] | .//*[local-name()="published"] | .//*[local-name()="updated"]')
|
||||||
|
|
||||||
pubdate = ""
|
pubdate = ""
|
||||||
if pubdate_nodes and pubdate_nodes[0].text:
|
if pubdate_nodes and pubdate_nodes[0].text:
|
||||||
pubdate = StringUtils.get_time(pubdate_nodes[0].text)
|
pubdate = StringUtils.get_time(pubdate_nodes[0].text)
|
||||||
|
|||||||
@@ -428,6 +428,12 @@ class SiteSpider:
|
|||||||
if pubdate_str:
|
if pubdate_str:
|
||||||
pubdate_str = pubdate_str.replace('\n', ' ').strip()
|
pubdate_str = pubdate_str.replace('\n', ' ').strip()
|
||||||
self.torrents_info['pubdate'] = self.__filter_text(pubdate_str, selector.get('filters'))
|
self.torrents_info['pubdate'] = self.__filter_text(pubdate_str, selector.get('filters'))
|
||||||
|
if self.torrents_info.get('pubdate'):
|
||||||
|
try:
|
||||||
|
if not isinstance(self.torrents_info['pubdate'], datetime.datetime):
|
||||||
|
datetime.datetime.strptime(str(self.torrents_info['pubdate']), '%Y-%m-%d %H:%M:%S')
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
self.torrents_info['pubdate'] = StringUtils.unify_datetime_str(str(self.torrents_info['pubdate']))
|
||||||
|
|
||||||
def __get_date_elapsed(self, torrent: Any):
|
def __get_date_elapsed(self, torrent: Any):
|
||||||
# torrent date elapsed text
|
# torrent date elapsed text
|
||||||
|
|||||||
Reference in New Issue
Block a user