Hi all,
I have made the following code that pulls links from a Youtube feed, but the feed provided is in .swf format and Kodi can't natively play that. How would I pass this into the Kodi Youtube plugin as I'm assuming that addon can play those types of files? I don't want to use most of the code that uses the YT plugin because I can't see a way to add more than one YT channel on there.
I found the following code that allows it to be added into a .strm stream file (Kodi guide link):
plugin://plugin.video.youtube/play/?video_id=$VIDEOID
I've tried a few variations, but how would I add the above into the following output for each link|?
(link being parsed: https://www.youtube.com/feeds/videos.xml?channel_id=UChLtXXpo4Ge1ReTEboVvTDg)
def get_playable_podcast1(soup1):
subjects = []
for content in soup1.find_all('entry'):
try:
link = content.find('yt:videoId')
link = link.get()
print("\n\nLink: ", link)
thumbnail = content.find('media:thumbnail')
thumbnail = thumbnail.get('url')
title = content.find('media:title')
title = title.get_text()
except AttributeError:
continue
item = {
'yt:videoId': link,
'title': title,
'thumbnail': thumbnail,
}
subjects.append(item)
return subjects
def compile_playable_podcast1(playable_podcast1):
items = []
for podcast in playable_podcast1:
items.append({
'label': podcast['title'],
'thumbnail': podcast['thumbnail'],
'path': podcast['yt:videoId'],
'is_playable': True,
})
return items
I have made the following code that pulls links from a Youtube feed, but the feed provided is in .swf format and Kodi can't natively play that. How would I pass this into the Kodi Youtube plugin as I'm assuming that addon can play those types of files? I don't want to use most of the code that uses the YT plugin because I can't see a way to add more than one YT channel on there.
I found the following code that allows it to be added into a .strm stream file (Kodi guide link):
plugin://plugin.video.youtube/play/?video_id=$VIDEOID
I've tried a few variations, but how would I add the above into the following output for each link|?
(link being parsed: https://www.youtube.com/feeds/videos.xml?channel_id=UChLtXXpo4Ge1ReTEboVvTDg)
def get_playable_podcast1(soup1):
subjects = []
for content in soup1.find_all('entry'):
try:
link = content.find('yt:videoId')
link = link.get()
print("\n\nLink: ", link)
thumbnail = content.find('media:thumbnail')
thumbnail = thumbnail.get('url')
title = content.find('media:title')
title = title.get_text()
except AttributeError:
continue
item = {
'yt:videoId': link,
'title': title,
'thumbnail': thumbnail,
}
subjects.append(item)
return subjects
def compile_playable_podcast1(playable_podcast1):
items = []
for podcast in playable_podcast1:
items.append({
'label': podcast['title'],
'thumbnail': podcast['thumbnail'],
'path': podcast['yt:videoId'],
'is_playable': True,
})
return items