Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cb5a1bfbbe | |||
| 98c37f2204 |
@@ -513,10 +513,10 @@ def parseDuration(strDuration):
|
||||
# newsFeed=NewsFeed('/home/pi/Projects/Python/NewsFeed/')
|
||||
# newsFeed=NewsFeed('/home/pi/.kodi/addons/plugin.video.fox.news/resources/lib/videodb.txt')
|
||||
# newsFeed=NewsFeed(PATH_VIDEO_DATABASE, myLog())
|
||||
# newsFeed=NewsFeed('/home/pi/Projects/Python/NewsFeed/', myLog())
|
||||
# newsFeed=NewsFeed('C:/Python/NewsFeed/Archive', myLog())
|
||||
# videos=newsFeed.getItemsInFeed(FOX_NEWS_URL)
|
||||
|
||||
# for video in videos:
|
||||
# if(video.description.startswith("Martha")):
|
||||
# print(f"Description={video.description}")
|
||||
# print(f"Url={video.url}")
|
||||
# print(f"getTimestamp={video.getTimestamp().toStringMonthDay()}")
|
||||
@@ -524,6 +524,7 @@ def parseDuration(strDuration):
|
||||
# print(f"getFeedTime={video.getFeedTime()}")
|
||||
# print(f"daysOld={(datetime.now()-video.getFeedTime()).days}")
|
||||
# print(' ')
|
||||
# print(f"Got {len(videos)} videos")
|
||||
|
||||
# pull the time out of the description and subtract it from the time we scanned the feed.
|
||||
# the result will be the time of the article..use this to sort on.
|
||||
|
||||
7
video.py
7
video.py
@@ -68,7 +68,12 @@ class Video:
|
||||
description=splits[0].strip()
|
||||
url=splits[1].strip()
|
||||
icon=splits[2].strip()
|
||||
timestamp=DateTime(splits[3].strip())
|
||||
datePart = splits[3].strip()
|
||||
timestamp = DateTime()
|
||||
try :
|
||||
timestamp=DateTime(datePart)
|
||||
except Exception as exception:
|
||||
print(f"Encountered invalid date '{datePart}'")
|
||||
return(Video(description,url,icon,timestamp))
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user