[REL] YouTube Metadata Agent

Apparently my directory issue is a python configuration problem due to having youtube-dl installed on the same machine.

I created a new jail and install plex and now I’m getting the same Found match with ID null error as the others.

The weird thing is that I’m running 1.18.2.2058

Is anyone else seeing com.plexapp.agents.none logs?

Seeing what about them specifically, I have them but they dont look to contain anything relevant.

My youtube and system agents don’t seem to be logging correctly and I hadn’t seen the none agent before.

Just trying to determine if that’s why my youtube logs weren’t showing up.

yes, too many users for my original key
Youtube is checking this project compliance so might loose my key…
Keeping you posted but this project loose priority for me, only got 2 donations and not using it for myself, and have my hands full right now (job, house, car, …)

1 Like

Unfortunately, I only realized recently that there was a 10k limit and I was spamming the crap out of your key.

I’ve since moved off onto my own. Sorry about that.

That also appears to be the reason I was having trouble with the older version of plex and the youtube agent. As it managed to pick up a video description.

What do you do for a day job?

YES! I finally got it working with an older version of Plex. Had to delete and recreate the library.

However, I have one question. Previously ASS didn’t work for me so I used the Plex Series Scanner.

Now that I’m using ASS everything is put into yearly seasons, which is cool, but the date appears to be based on the file system date, not the YT metadata.

I wasn’t sure whether to post here or in the ASS thread.

Thanks.

Just to say that someone pushed a fix to the youtube agent and it is working again with the latest version of plex.

Enjoy.

1 Like

I just don’t understand the documentation for naming convention and how, or if, to get videos sorted by upload data.

My current naming convenstion is;
Folder: channelname [channelID]
Files: channelname - title [youtube-videoID]

All videos are being found and metadata downloaded, but I’m unclear as to why the sorting is so wrong.

I just want all videos from a channel to show up in Plex sorted by date uploaded with the newest first. Plex seems to do whatever the hell it wants and doesn’t sort by “Originally Available”

Edit: I think I’ve found the issue, for a bunch of videos, the file date is totally wrong. No idea why, or how to fix it.

From memory youtube-dl downloads videos with the time/date that they were uploaded, which is not necessarily the date/time that they were made viewable.

Some channels upload their videos days/weeks before they make them available to view.

2 Likes

It was way more than an uploader letting a video sit for some time before publishing; I had videos uploaded/released in 2018 with the the download date or other random dates in 2020. Maybe an issue with YouTube or youtube-dl; I have no idea.

I worked around the issue by getting youtube-dl to include the upload date in the file name and then using another app, Advanced Renamer, to use that string in the file name to edit the files modified date.

@Bai_Shen I work as Network engineer in Dell in Ireland, but am French and building a house in France but a bit tight with the mortgage, so will work in it for a month when i can fly again, starting working the Sunday instead of the friday for a 8% bonus to help a bit in that matter.

For the scanner, the issue was for playlists, quite some were on reverse order (1st ep is the latest video released), forcing to renumber every episode every time…
This is why the file date was choosen, also because youtube-dl did update the creation time on my ntfs partition so it was convenient.
Sorting per year also helps with huge playlist/channels

If any of you find a fix, do a pull request on github, or send me the info and I will update the readme

I am having an issue with titles that start with a number. it gets scanned as the same video even though i have the naming as channel [channelid] /Title - Upload Date - [Video_id].mkv
I’ve tested with no upload date and it didnt make a difference.

The naming convention for my files is as follow (on windows)

$hh = [DateTime]::Now.ToString("HH")
$dd = [DateTime]::Now.ToString("dd")
$MM = [DateTime]::Now.ToString("MM")
$yyyy = [DateTime]::Now.ToString("yyyy")

$downloadlocation = 
"I:\TV\YouTube\%(uploader)s [%(channel_id)s]\%(uploader)s - s$yyyy"+"e1"+"$MM$dd$hh%(playlist_index)s - %(title)s  [%(id)s].%(ext)s"

As you can see I essentially…

  • use the UPLOADER as the show name

then

  • use the current YEAR as a season number,

for the EPISODE I use

  • 1 followed by month displayed as two digits (other wise months that start with a 0, i.e. JAN-SEP drop the leading 0)
  • next is date displayed as two digits
  • hour displayed as two digits (as I run my download script hourly)
  • On the end of that I append the playlist position number in order to prevent duplicate numbered episodes should a channel upload more than one video per hour (it happens rarely).
  • Finally I add the episode title and UID

Using this method means that I can use the standard plex scanner and not the ASS

3 Likes

thank you. I’ll give that a try and see how it does.

how’s this handle videos/channels that have since been taken down from youtube?
can this agent get the required metadata from the nfo dumped into the directory by youtube-dl?

@harroguk Hey buddy, this is extremely helpful.
Admittedly though, i dont want to read 200 posts, so can you tell me program the naming conventions are for? For Windows? Ive been trying to get this set up for months now with no luck, and if I can get this working without all the agents, id love it.

Any help would be AWESOME!

You will need two things,

1> The metadata agent from this thread (Post 1). That will scrape and import that metadata for the files that you download from youtube with…
2> youtube-dl - https://github.com/ytdl-org/youtube-dl

If you name the files as per my previous post then you dont need the ASS (scraper) as also created by @ZeroQI but you will kind of be on your own when it comes to things not matching up as his supported solution is with the ASS.

Finally, if you do get it working then throw @ZeroQI $5, this project gets minimal attention (all support is graciously received) due to the lack of donations that he ever received for it (Around 5 donations in 7 years).

2 Likes

@harroguk Any chance you would want to share a sample config file for youtube-dl. All the options are a bit overwhelming. Any help would be appreciated.

Its not really relevant to the thread here so I have PMd it to you.