The only way I could get the agent to load any metadata into the files was to select APIOnly as the option. JSON with API backup wouldn’t match any descriptions or load anything with it.
Thank you for this tool!
I think this has been addressed before, but I haven’t been able to discover the answer trawling through the thread.
What governs the season/episode associations?
I am using this naming scheme for my folders/files:
W:\YOUTUBE\Channel Name [Channel_ID]\airdate - video name - (duration) [video_ID].ext
Example:
W:\YOUTUBE\Acorn To Arabella [UCAiDWnTP0WB1xCp6uuUo0VA]\20161118 - Splitting Log - (301s) [dyB_L__LMPA].nfo
The season/episode selection seems partially based on date, but doesn’t seem to consistently produce valid results.
The naming convention I use is in this post (further up in the thread)…
It has been working comfortably for over a year now with no incorrect matches.
Has anyone been able to use the YouTube.Agent and split channels into seasons by upload year? I’m really hoping to be able to do something like this to make it easier to browse so I don’t have a few thousand videos in one current year “season”.
The post directly above yours.
I’ve looked at it, but I am doing something slightly different. I do not want the current year. I would like the videos to be grouped by the upload year and treat that as the season.
I manually created some new items (with description, info.json and webp files) in the following naming format but it fails to separate them into different seasons in Plex and they are just lumped into one 2020 season:
S2015 E001 - TITLE [VIDEO_ID].mkv
S2016 E010 - TITLE [VIDEO_ID].mkv
S2017 E100 - TITLE [VIDEO_ID].mkv
This is a separate problem from when I did this last time as then I had seasons but no metadata…Now I have metadata and no seasons 
Edit:
While writing this I figured it out
. I had to delete my entire library and create a new one. I couldn’t just adjust the scanner back to the Plex scanner and force a metadata refresh.
For those interested in my Linux solution or looking for something similar, here is what I did
youtube-dl output format:
-o "/Downloads/%(uploader)s [%(channel_id)s]/S%(upload_date)s E%(playlist_index)s - %(title)s [%(id)s].%(ext)s"
Renaming command for trimming upload_date (run in each channel folder):
for file in * ; do mv "$file" "${file::5}${file:9}" ; done
I’m trying to improve this so I can get all files using find and just run it once when the download completes but find results include the folder path which is different across channels. If anyone has a better solution that I have come up with, please let me know!
I am absolutely loving the functionality for this plugin but I’m running into a small problem. I can not seem to get playlists to show up. Individual shows that are under a channel’s folder show up, but getting playlists to show up is simply not working for me. This is my directory tree
W
:.
└───GameGrumps [UC9CuvdOVfMPvKCiwdGKL3cQ]
│ 001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
│
├───Bloodborne OLD
│ 001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
│ 002 - Bloodborne - The Purge - PART 2 - Game Grumps [_6jh-rY7--U].mkv
│ 003 - Bloodborne - Turning Heads - PART 3 - Game Grumps [JBvEBPiMshc].mkv
│ 004 - Bloodborne - Death Barf - PART 4 - Game Grumps [RpBdel8Btgs].mkv
│ 005 - Bloodborne - Date With Death - PART 5 - Game Grumps [_r11R5JK1j8].mkv
│ 006 - Bloodborne - To Fight or Not to Fight - PART 6 - Game Grumps [NTCPH4VbUq4].f137.mp4.part
│
└───Bloodborne [PLRQGRBgN_EnqGHZ_4ZVWBj1MTfpDQeU-N]
001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
002 - Bloodborne - The Purge - PART 2 - Game Grumps [_6jh-rY7--U].mkv
003 - Bloodborne - Turning Heads - PART 3 - Game Grumps [JBvEBPiMshc].mkv
004 - Bloodborne - Death Barf - PART 4 - Game Grumps [RpBdel8Btgs].mkv
005 - Bloodborne - Date With Death - PART 5 - Game Grumps [_r11R5JK1j8].mkv
006 - Bloodborne - To Fight or Not to Fight - PART 6 - Game Grumps [NTCPH4VbUq4].mkv
007 - Bloodborne - CHARGE....NOT CHARGE - PART 7 - Game Grumps [cXTnzkc5ND4].mkv
008 - Bloodborne - Smash the Pots! - PART 8 - Game Grumps [YZqQWvRkH1I].f137.mp4
When I pull files from those folders and just put them in the channel directory they work fine, so I know it isn’t a problem with my video naming, at least as far as I can see.
Try adjusting your naming convention to something that is series/episode based…
also I would advise using the Plex Media Scanner rather than the ASS if you are using that.
:.
└───GameGrumps [UC9CuvdOVfMPvKCiwdGKL3cQ]
│ s01e001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
│
├───Bloodborne OLD
│ s02e001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
│ s02e002 - Bloodborne - The Purge - PART 2 - Game Grumps [_6jh-rY7--U].mkv
│ s02e003 - Bloodborne - Turning Heads - PART 3 - Game Grumps [JBvEBPiMshc].mkv
│ s02e004 - Bloodborne - Death Barf - PART 4 - Game Grumps [RpBdel8Btgs].mkv
│ s02e005 - Bloodborne - Date With Death - PART 5 - Game Grumps [_r11R5JK1j8].mkv
│ s02e006 - Bloodborne - To Fight or Not to Fight - PART 6 - Game Grumps [NTCPH4VbUq4].f137.mp4.part
│
└───Bloodborne [PLRQGRBgN_EnqGHZ_4ZVWBj1MTfpDQeU-N]
s03e001 - Bloodborne - Come at Me, Beast! - PART 1 - Game Grumps [g0dJ-NhPR2A].mkv
s03e002 - Bloodborne - The Purge - PART 2 - Game Grumps [_6jh-rY7--U].mkv
s03e003 - Bloodborne - Turning Heads - PART 3 - Game Grumps [JBvEBPiMshc].mkv
s03e004 - Bloodborne - Death Barf - PART 4 - Game Grumps [RpBdel8Btgs].mkv
s03e005 - Bloodborne - Date With Death - PART 5 - Game Grumps [_r11R5JK1j8].mkv
s03e006 - Bloodborne - To Fight or Not to Fight - PART 6 - Game Grumps [NTCPH4VbUq4].mkv
s03e 007 - Bloodborne - CHARGE....NOT CHARGE - PART 7 - Game Grumps [cXTnzkc5ND4].mkv
s03e008 - Bloodborne - Smash the Pots! - PART 8 - Game Grumps [YZqQWvRkH1I].f137.mp4
for whatever reason the plugin will put the full path as name for my vids, they are under movie and the name of those are just the id. Before it was working great where the plugin was abble to add title for the video
The same thing is happening for me. I am using the YoutubeSeries agent and it is pulling the video name/episode title correctly, but the channel name/show title is using the full directory path. I am on Plex server version 1.21.0.3616 running on Nvidia Shield.
I can confirm that it was fixed for me with the latest update https://github.com/ZeroQI/YouTube-Agent.bundle/pull/51
Ah, thank you for sharing that. That issue has been driving me nuts on a recent server migration and that was exactly what I needed. Now to try a more current version of ASS and the Agent than my old legacy versions.
I’m not getting the posters or the date to load into the data. The mp4 is downloaded along with the jpg and description. I could be missing something though.
Example:
GorrillaCraft (GorrillaCraft)/Let’s Build/5 - 20130313 - Minecraft _ Let’s Build - Shipyard & Mine _ Rise of a Kingdom _ Ep.5 WORLD DOWNLOAD! - (407s) [1920x1080] [EAOp4Vzf7yc].mp4
The originally available date is working when the library is set to movies but that doesn’t make sense with hundreds of “episodes” per YouTube playlist, etc. But this is also only working for some.
At this point, I’ve also written a script to rename the files however is needed. I’ve also tried just the title and video id without luck. Some titles/file names also have “—” and “-” in them.
Why are the playlist nor channel id specified in series foldername?
Ah ok, I must’ve missed that. So playlist id or channel id will do it? I’ll write a script to rename if that’s the case. Appreciate it.
ZeroQI, Thank you for this plugin.
I am having an issue where Plex is getting both the title and posters wrong for a large library. As shown in this picture, it is pulling in the wrong title, and I have posters downloaded along with videos via youtube-dl
Stupid question time. I’m installing the agent on a new machine so I went and grabbed the latest version. I now see an option for metadata source with the default of “jsonWithApiBackup”
I looked on the git page and didn’t see anything referencing that nor was I able to find anything in this thread. Am I correct in assuming that it’s using the metadata produced by the --write-info-json option of youtube-dl?
Is there anything special handling I need to do with the resultant .info file?
Thanks.
Is anyone else having a problem with the metadata not being updated? I’m seeing the following error in the logs.
2021-02-09 20:14:17,400 (80835f500) : INFO (__init__:386) - update()
2021-02-09 20:14:17,400 (80835f500) : INFO (__init__:62) - /digital/youtube/LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]/Season 00/S00E01 - 1209_This_Tiny_WiFi_Camera_Owns_Kwikset_SmartKey_LockTech_LTKSD [DGdsIrAjp3k].mp4
2021-02-09 20:14:17,400 (80835f500) : INFO (__init__:62) - /digital/youtube/LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]/Season 00/S00E01 - 1209_This_Tiny_WiFi_Camera_Owns_Kwikset_SmartKey_LockTech_LTKSD [DGdsIrAjp3k].mp4
2021-02-09 20:14:17,401 (80835f500) : INFO (__init__:396) - =============================================================================================================================================================
2021-02-09 20:14:17,401 (80835f500) : INFO (__init__:398) - Attempting to load details from json file - json_filename: /digital/youtube/LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]/Season 00/S00E01 - 1209_This_Tiny_WiFi_Camera_Owns_Kwikset_SmartKey_LockTech_LTKSD [DGdsIrAjp3k].info.json
2021-02-09 20:14:17,401 (80835f500) : INFO (__init__:597) - =============================================================================================================================================================
2021-02-09 20:14:17,401 (80835f500) : INFO (__init__:597) - update() using json file with api as backup - guid: sdnXmbfshww, dir: /digital/youtube/LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]/Season 00, metadata.id: youtube|sdnXmbfshww|LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]
2021-02-09 20:14:17,401 (80835f500) : INFO (__init__:74) - [!] Library access denied
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:77) - [!] ASS root scanner file present: "/usr/local/plexdata/Plex Media Server/Plug-in Support/Data/com.plexapp.agents.hama/DataItems/_Logs/_root_.scanner.log"
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:458) - [ ] dir: "/digital/youtube/LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]/Season 00"
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:459) - [ ] library: ""
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:460) - [ ] root: ""
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:461) - [ ] path: "_unknown_folder"
2021-02-09 20:14:17,402 (80835f500) : INFO (__init__:576) - No GUID so random folder
2021-02-09 20:14:17,403 (80835f500) : INFO (__init__:638) - =============================================================================================================================================================
2021-02-09 20:14:17,403 (80835f500) : INFO (__init__:639) - Season: 0
2021-02-09 20:14:17,403 (80835f500) : INFO (__init__:647) - metadata.seasons[ 0].episodes[ 1] "S00E01 - 1209_This_Tiny_WiFi_Camera_Owns_Kwikset_SmartKey_LockTech_LTKSD [DGdsIrAjp3k].mp4"
2021-02-09 20:14:17,403 (80835f500) : CRITICAL (agentkit:1095) - Exception in the update function of agent named 'YouTubeSeries', called with guid 'com.plexapp.agents.youtube://youtube|sdnXmbfshww|LockPickingLawyer [UCm9K6rby98W8JigLoZOh6FQ]?lang=xn' (most recent call last):
File "/usr/local/share/plexmediaserver/Resources/Plug-ins-3c3adfcb4/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/api/agentkit.py", line 1093, in _update
agent.update(obj, media, lang, **kwargs)
File "/usr/local/plexdata/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 679, in update
def update (self, metadata, media, lang, force ): Update (metadata, media, lang, force, False)
File "/usr/local/plexdata/Plex Media Server/Plug-ins/YouTube-Agent.bundle/Contents/Code/__init__.py", line 668, in Update
episode_metadata_retrieved = populate_episode_metadata_from_info_json(series_root_folder, filename, episode, metadata, first, episodes, genre_array, channel_title)
UnboundLocalError: local variable 'series_root_folder' referenced before assignment
To echo a previous poster everything works just fine if I select api only for the metadata source. What’s weird is that in one place it says there’s no guid but in another it says there is. Not sure if that’s related as the problem seems to be that it tries to get the library path but can’t find it on 462 so it never sets the series_root_folder on line 464.
Thanks, I do already follow the naming convention [channelid]/[videoid], this particular youtube channel is not done via playlists but rather the entire channel’s catalog so the folder has a considerable amount of videos.
The solution to this actually appears to be forcing plex to unmatch the content then re-automatch via youtube-series. After a day content was named correctly and used the poster’s I already had for videos.
