meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.96k stars 123 forks source link

{playlist_index} tag in titles returns 'None' #142

Closed HStep20 closed 3 years ago

HStep20 commented 3 years ago

Added the tag to an output title, and each title comes back with 'None' in the place where the index should be.

meeb commented 3 years ago

Unfortunately the playlist index isn't available any more in the metadata so I'll likely just have to remove this macro / tag from the options.

HStep20 commented 3 years ago

Which version of Youtube-dl is running? I was able to run a command via command line with it, and it still pulled the 'playlist_index' metadata, and embedded it into the title of the files I grabbed.

This is with 2021.06.06 - The latest version according to 'youtube-dl --update'

meeb commented 3 years ago

Yes youtube-dl does return a playlist_index if you poll the metadata for a full playlist or channel which contains playlists. This was supported in earlier releases of TubeSync. hence the maco being present. The issue was this required a full metadata crawling of all sources and media items every scheduled re-indexing which quickly caused YouTube to throttle your IP within a day or so. The new indexing method is to "bare" index channels to just get the video unique IDs and then just get the metadata for each unique video just once. This dramatically increases the speed of indexing and reduces the number of requests to YouTube (and greatly reduces the chance you will get throttled), however, it does unfortunately make some metadata unavailable.

If you pick a random video off of any playlist and use youtube-dl to get its metadata you'll see that there is no playlist_index set and it's not available, which is why it's no longer available in TubeSync. Videos can be in multiple playlists so when just getting the metadata for a single video the concept of a playlist_index doesn't make much sense.

I can't easily see any solution to this, going back to full indexing isn't going to work and the playlist_index isn't really available any other way. It may be potentially possible to patch youtube-dl to include the playlist_index in the bare channel level index crawl (or maybe one of the feature forks already as this option) but if it does exist it's well hidden and I've not found it yet.

HStep20 commented 3 years ago

Thanks for the explanation. Unfortunate that that's the case, since most use the playlist index as an episode number in naming schemes.

meeb commented 3 years ago

Yes, unfortunate indeed. I used the playlist index in naming schemes myself.