umputun / feed-master

Pulls multiple podcast feeds (RSS) and republishes as a common feed, properly sorted and podcast-client friendly.
https://feed-master.umputun.dev
MIT License
116 stars 26 forks source link

How to delete YT feed #105

Closed alfonder closed 1 year ago

alfonder commented 1 year ago

Not really an issue, rather a request. If I don't want to process a youtube channel, then removing it from the config is not enough as I noted. All already converted files remain on the storage. And also I guess DB entries are not deleted. So I think I should use admin API. But it's unclear how to do it. Is it possible to delete all channel's entries with a mask? Otherwise where to get entry ids? For example, here is the snippet from rss:

<item>
<title>
Екатерина Шульман: Безумно богатые русские. От олигархов к новой буржуазии / Книжное казино. Истории // 07.01.2023
</title>
<link>https://www.youtube.com/watch?v=QqfVcDEgDS8</link>
<description>
В первом в этом году выпуске программы... 
</description>
<enclosure url="https://feed.myserver.xx/yt/media/8c390919daa769e308eac77f4d60cfcbf90bab87.mp3" length="64355071" type="audio/mpeg"/>
<guid>UCuIE7-5QzeAR6EdZXwDRwuQ::QqfVcDEgDS8</guid>
<pubDate>Sat, 07 Jan 2023 12:04:37 +0000</pubDate>
<author>Дилетант</author>
<itunes:duration>3273</itunes:duration>
</item>

I tried to use curl as following:

curl -X "DELETE" -u admin:mycoolpass --basic  http://feed.myserver.xx/yt/entry/UCuIE7-5QzeAR6EdZXwDRwuQ/QqfVcDEgDS8

And I get "301 Moved Permanently" Also either ID from mp3 filename or ID from YT video don't work. The same error returned. Please, explain me how to perform deletion.

umputun commented 1 year ago

301 is not from the feed master but likely from the proxy you have in front. The correct call invoked directly to the feed-master should remove the physical mp3 file from your disk and clean it from the internal DB.

As of now, there is no similar method to remove all the episodes from the channel automatically, just one by one. I'm not really sure if such a method really needed - if you don't want some yt feed to be removed from your RSS you can just remove it from feeds. This will leave all the files in place but should remove them from the final RSS. In case you really want to remove all the part permanently, the best way I can think of is to set keep to 1 and after the refresh and removal of all the other files invoke the DELETE API call to remove the last one.

Adding such an admin call to API is also possible. If someone wants to implement it I'll accept such a PR.

umputun commented 1 year ago

regarding "Otherwise where to get entry ids?" it looks like you have figured it out - you can get both channel and video IDs from the RSS, as it built like this: GUID: entry.ChannelID + "::" + entry.VideoID

alfonder commented 1 year ago

Thank you. It works via un-proxied connection.

{"removed":"QqfVcDEgDS8","status":"ok"}