1
0

Only download videos from more recently than the specified date (if given).

This commit is contained in:
Pierre Cazenave 2018-10-08 12:42:01 +01:00
parent b723abc9d8
commit f73247b2b0

5
dl.py
View File

@ -72,9 +72,8 @@ if __name__ == '__main__':
print(f'Parsing through channel {i + 1} of {len(urls)}', end='\r')
feed = feedparser.parse(url)
for item in feed['items']:
timef = item['published_parsed']
dt = datetime.fromtimestamp(mktime(timef))
if dt > ptime:
video_time = datetime.fromtimestamp(mktime(item['published_parsed']))
if video_time > threshold_time:
videos.append(item['link'])
if len(videos) == 0: