podcast: fallback pubDate parsing method
This commit is contained in:
parent
924615b282
commit
e9a37cf0f2
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@ import random
|
||||||
import sys
|
import sys
|
||||||
from subprocess import CalledProcessError, check_output
|
from subprocess import CalledProcessError, check_output
|
||||||
|
|
||||||
|
import dateutil.parser
|
||||||
import requests
|
import requests
|
||||||
from lxml import html
|
from lxml import html
|
||||||
from pytimeparse.timeparse import timeparse
|
from pytimeparse.timeparse import timeparse
|
||||||
|
@ -111,6 +112,7 @@ def get_item_date(el):
|
||||||
return datetime.datetime.strptime(el_date.text, time_format)
|
return datetime.datetime.strptime(el_date.text, time_format)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
return dateutil.parser.parse(el_date.text)
|
||||||
|
|
||||||
|
|
||||||
def get_audio_from_item(item):
|
def get_audio_from_item(item):
|
||||||
|
|
Loading…
Reference in a new issue