MLTSHP / best-of-mltshp-bot

Posts new feed items to Mastodon
1 stars 0 forks source link

Video embeds are not handled #6

Open dphiffer opened 3 months ago

dphiffer commented 3 months ago

Currently the bot script assumes that every RSS entry will have a URL that looks like https://mltshp.com/r/[id], and when it comes upon a video embed it just errors out.

Example RSS:

<item>
<title> Bang Bang / I Will Survive </title>
<link>https://mltshp.com/p/1Q2MN</link>
<description>
<p> <iframe sandbox="allow-scripts allow-same-origin allow-popups" referrerpolicy="no-referrer-when-downgrade" allow="encrypted-media" loading="lazy" fetchpriority="low"class="youtube-player" type="text/html" width="550" height="339" src="https://www.youtube.com/embed/9zWZU8VvmZk?fs=1&feature=oembed&rnd=0.0934397432803" frameborder="0" id="ytframe" allowfullscreen></iframe> </p> I&#39;m on the banjo. Excuse my facial expressions, please. I forget other people can see me.
</description>
<pubDate>Fri, 24 May 2024 18:03:02 </pubDate>
</item>
dphiffer commented 3 months ago

The bot no longer assumes each RSS entry has a specific media URL, but it still ignores video embeds. We could probably just link to the videos, assuming we can convert the iframe href attributes to video share URLs.