-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Channel episodes not updating metadata #141
Comments
Youtube prefix is supported for series/movies forced id but not at video level Good video ID: [1vjvR4nEJr8] |
I dropped the Logs:
|
It can find the Jason file and can findbthe title and summary from it, and the line outputting the field also update the metadata field, so the agent find the right information but plex won't show it? Date duration thumb seem ok, but tile and summary are NOT updated... Pretty sure plex fault since agent logs show the fields correctly |
Given that the plugin can properly update the metadata for playlist items, just not channel items, is there a place where the metadata change is logged? Some preliminary |
https://github.com/ZeroQI/YouTube-Agent.bundle/blob/master/Contents/Code/__init__.py#L404 |
I verified/repaired my database via ChuckPa's tool, and the results did not change. Enabling debug logging and diving into logs, I have found something interesting when refreshing metadata:
Notably, from the first log file, it seems Plex is looking for a non-existent Diving in to the container confirms this:
I am not sure where the discrepancy for the XML file comes from. The correct date is listed in the file name:
The accompanying
And embedded in the video file itself:
Digging around with another channel mirror, I experience the exact same behavior, Plex is trying to open XML files that are 1 day later than the day the video was published. I've tried enabling verbose logging but still can't see where the call for the incorrect XML file originates from. Are these XML files created by the YouTube Agent, or by Plex from data passed to it by the YouTube Agent? |
Adding to the above, setting the library type as Could the agent be tweaked to use a scheme closer to that of a "Daily show" format? Where all the files could be sorted by something like:
And the agent determines their ordering based on their publish date, and/or upload timestamp in the case of videos published on the same day? I tried to organize my directory as such, but when I do, it changes the series name on Plex to Season 2019, and still does not identify the video correctly. |
When you have a playlist, the scanner keep them in order even if the playlist is reversed, so that the numbering doesn't change as new videos are published. This is why playlists are most stable for the scanner and agent For channel videos. A date placeholder is used and when metadata is put, the season and ep number is chosen, which doesn't like multiple videos on the same date... This is tricky, so the year was used as a season, to make it simpler... Video id in playlist/channel: https://github.com/ZeroQI/YouTube-Agent.bundle/blob/master/Contents/Code/__init__.py#L524
This line is responsible for updating from JSON file: https://github.com/ZeroQI/YouTube-Agent.bundle/blob/master/Contents/Code/__init__.py#L582 In regards to video id, you can use 'youtube-' according to the code |
Certainly. To try and make things more clear, I removed all contents of the directory, and bypassed TubeSync to use
Following downloading this file, here is what is displayed in the logs:
As a result, the media is added to Plex. The channel is correctly identified, and appropriate metadata is applied. But when I navigate to the individual video, all that shows is the title of the video, none of its associated metadata. Video for clarity: 2023-08-10.10-47-38.mp4So rather than this: I am expecting this: |
Director summary title missing despite being found (it give the line number in the code after init) There could be a bug with the date based episodes however, but outside the agent control... |
No difference, unfortunately:
|
Episode number is still a date though... |
So I'm skeptical of the root problem being a naming scheme issue. In the interest of testing this out more, I delisted every video on my own channel except for 6. I put those 6 videos on a playlist. Meaning that currently, my own channel and the test playlist I made are the same: Channel: https://www.youtube.com/channel/UCw3wlMHLmsE7x1b2_9cAOBA I pulled all of the data into two directories via
As you can see, the file names, md5sums, and structure are identical. The only difference is that one parent directory has With this, the same issue persists. As expected, the two items present based on their source in Plex, and with proper metadata: The playlist episodes all appear as one season, and the episodes all have metadata properly applied: The channel episodes appear as three seasons, and metadata for the channel itself is applied to the series (Channel with 182 videos...) However, metadata is not applied for each episode: Furthermore, there's a matching issue. The "Season 2023" folder matched all 3 videos as one: Given this behavior despite identical files and individual file names, I would think it has to point at something else. I'm not fluent enough in python to read through the source of init.py, but if the only difference in this example is the regex match of the parent folder, would that not point to an issue with the way the metadata is processed by the agent and then passed to Plex? |
I haven't paid the tax yet, but just wanted to mention that I am seeing the same behavior on my install as well. Tried on both my Synology server and my CentOS server. Wget and "git clone" to pull the latest agent and scanner. The scanner finds all of the files (don't have the youtube prefex) and the agent is able to match the id according to the logs (shows title, details, etc.), but for many files the data is not shown in Plex. I have tried using json files as well as just pulling the data with the google api (when the json is missing) and the results are the same. Anyway, don't mean to pile on or anything as I think it is awesome that you are working on this project. Don't want to discourage anyone. ;) Just thought I would mention that you aren't alone. |
Is there an older version that doesn't have these issues? There was a code push in latest that wasn't fully tested... |
I'm not sure because I am a new user and just grabbed the latest. |
I'm not sure, as I am a new user as well. I don't see releases versioned out on the Releases page, and only a Master branch. If you tell me when the code push you're referring to was made, I can try and roll back to that version and test again. |
To follow up on this, are you able to recommend a specific commit/version @ZeroQI? |
2 people impacted on the very latest that came out a week ago... Use the version just before that |
Unfortunately rolling back does not seem to change the behavior. I rolled back to the commit from January 20, 2023, removed the items from the library entirely, then re-added them to the library. Results are the same: Identical files, names, and structures, other than the name of the parent folder containing either the Playlist ID or the Channel ID. Channel ID still does not display metadata correctly. Logs are similar as well:
I would love to offer a pull request to fix this, but sadly I have no knowledge of python to offer such a pull request. I suppose the workaround in the mean time is to back up my YT Playlists to one library set up as a series, and my YT channels to another library set up as movies, as the agent works and applies metadata correctly if the library type is set to movie instead of series. The ideal behavior (for me, anyways) would be to put them both in a series library. If I want to set up an automatically sync/download for a particular channel so I can have their latest video(s) when I'm out and about without good service, it's much easier to set Sync up to download the 5 latest unwatched videos from a series library, rather than having to add/remove individual items from a movies library. |
I think I may have found the problem. Despite not knowing Python, I was picking through the code of
Items indexed in a folder that matches the regex for a channel rather than a playlist should have metadata applied to them from this line, shouldn't they? The comment indicates that this isn't used, nor do I see that variable appear anywhere else in the script. This seems to be mirrored by the logs stating that they perform an API call for the playlist. For the playlist:
But for the channel:
I would suggest that an easy solution here could be: If the folder is a channel, all videos on the video should be indexed via the |
I'm having issues with this as well. I'm trying to download the monologues from Late Night with Stephen Colbert, playlist PLiZxWe0ejyv8CSMylrxb6Nx4Ii2RHbu_j I'm using: |
Just want to add that I'm experiencing this exact same issue; including the mismatch (by 1 day) on xml files in I have 2 docker instances of youtube-dl; one specific to downloading various playlists from various youtube channels, and all is working fine for that content. The other docker instance is specific to downloading full channels, and that is the one that is giving me problems. Channel metadata is matching just fine, but individual video metadata matching is not working as expected, even though agent logs show the metadata is being read successfully from the .info.json file. Running latest youtube agent and ASS, with Plex 1.32.7.7571 on qnap. |
#141 It used to be Jun 19, 2018 in b0333dc: ``` # Loading Channel if guid.startswith('UC'): try: json_channel_items = json_load(YOUTUBE_CHANNEL_ITEMS.format(guid)) #Choosen per id hence one single result except Exception as e: Log('exception: {}, url: {}'.format(e, guid)) else: Log.Info('json_channel_items: {}'.format(len(Dict(json_channel_items, 'items')))) ``` commented Aug 8, 2018 to Jun 19, 2018 in https://github.com/ZeroQI/YouTube-Agent.bundle/blob/fa539c658dc1d7e77667c876b5cb4c7570f4a0f6/Contents/Code/__init__.py Later deleted
Line 404 for channels json_channel_items seem used but never populated
It used to be Jun 19, 2018 in b0333dc:
commented Aug 8, 2018 to Jun 19, 2018 in https://github.com/ZeroQI/YouTube-Agent.bundle/blob/fa539c658dc1d7e77667c876b5cb4c7570f4a0f6/Contents/Code/__init__.py |
Paid the RTFM tax!
This appears to be similar to #124, but I wanted to create a separate issue to keep the details relevant to my findings in one place.
Library is set as series/TV show, and uses
Absolute Series Scanner
for the Scanner, withYouTubeSeries
for the lAgent*. Both aregit pull
from last night, so neither should be outdated.I have two sources being indexed via TubeSync, one is a channel (with 1 video), the other is a playlist (with 39 videos). Although I have input my own API key for YT, I also have
.info.json
files adjacent to the video files, channel/playlist ID in the base directory, and video ID in the filename. Trunctuating to just 1 video from the playlist for the sake of shortening output, here is the formatting used:For the Playlist, all items are detected, and metadata is applied correctly to the Series, Season, and Episodes.
For the Channel, all items are detected, and metadata is applied correctly to the Series and Season, but not the Episodes. The individual episode files appear as their literal filename, with no metadata applied at all.
Here's what I think is the relative output from
com.plexapp.agents.youtube.log
:It seems like the agent is matching the correct information for the video, but it's not actually being applied? Am I missing a step somewhere?
The text was updated successfully, but these errors were encountered: