Testing sequence for feeds

main
Bob Mottram 2020-11-22 16:10:58 +00:00
parent a7de74bb81
commit e0e31e8330
1 changed files with 6 additions and 6 deletions

View File

@ -477,7 +477,12 @@ def xmlStrToDict(baseDir: str, domain: str, xmlStr: str,
maxFeedItemSizeKb: int) -> {}:
"""Converts an xml string to a dictionary
"""
if 'rss version="2.0"' in xmlStr:
if '<yt:videoId>' in xmlStr and '<yt:channelId>' in xmlStr:
print('YouTube feed: reading')
return atomFeedYTToDict(baseDir, domain,
xmlStr, moderated, mirrored,
maxPostsPerSource, maxFeedItemSizeKb)
elif 'rss version="2.0"' in xmlStr:
return xml2StrToDict(baseDir, domain,
xmlStr, moderated, mirrored,
maxPostsPerSource, maxFeedItemSizeKb)
@ -485,11 +490,6 @@ def xmlStrToDict(baseDir: str, domain: str, xmlStr: str,
return atomFeedToDict(baseDir, domain,
xmlStr, moderated, mirrored,
maxPostsPerSource, maxFeedItemSizeKb)
elif '<yt:videoId>' in xmlStr and '<yt:channelId>' in xmlStr:
print('YouTube feed: reading')
return atomFeedYTToDict(baseDir, domain,
xmlStr, moderated, mirrored,
maxPostsPerSource, maxFeedItemSizeKb)
return {}