ZeroQI / YouTube-Agent.bundle

Plex Metadata Agent for Movies and TV Series libraries
452 stars 43 forks source link

Old Video Poster Not Being Removed When Episode Number Changes #17

Closed selkiess closed 5 years ago

selkiess commented 5 years ago

Agent works great, been migrating a youtube library over to plex and noticed some oddities with the posters on episodes. Description and everything else is correct.

My guess is that as more episodes are added and episode number changes the poster from what used to be that episode is kept. The new poster is downloaded and available for selection, it is just not set as the default one every time.

What Poster section Looks Like(The right poster is "Net Neutrality" but another videos is selected: image

Logs; com.plexapp.agents.youtube.log

com.plexapp.agents.youtube.log

ZeroQI commented 5 years ago

Which is why a playlist id is better, as the épisode number is forces by the scanner. What happen on a metadata update on that sériés?

selkiess commented 5 years ago

Refreshing metadata does not change the poster or remove any bad ones. I want to do playlists but most of the channels I want to backup do not have playlists for everything.

selkiess commented 5 years ago

A solution to this temporarily seems to be deleting the library, cleaning bundles, then re-adding the library.

When a new episode is added it will probably change the episode number though and could cause it again.

Not sure if there is a way for an agent to force the use of the just downloaded image over the ones plex has in cache or clearing the episode cache but that would fix the problem permanently.

ZeroQI commented 5 years ago

Notes:

@Selkie707 please test new version and report

selkiess commented 5 years ago

The poster issue seems to still be occurring. I deleted, cleaned bundles, and recreated the library then started downloading more videos to be sure. One thing i did notice is that while downloading/adding videos it would temporarily show an episode twice, same poster, same name, etc. The get info would show that they were definitely distinct videos.

Logs: com.plexapp.agents.youtube.log com.plexapp.system.log Cody'sLab.scanner.log com.plexapp.system (2).log

selkiess commented 5 years ago

If you want to test it on your end my youtube-dl stuff: https://drive.google.com/file/d/1H2TepQ8wDnd9IY2w0-B0Wllx5-L9EMmV/view

I have all that directly in the folder that plex scans for the youtube series library and youtube-dl runs there.

ZeroQI commented 5 years ago

@Selkie707 please test new version and report. had cleaned fist ep screenshot used as p[oster, not the ep itself, should be solved now

selkiess commented 5 years ago

At first glance it seems to be doing much better. Out of the initial 10 episodes downloaded with the new build only 1 had a duplicate poster. In case it was just a fluke I am going to let it run overnight downloading ~300 episodes and see how the posters look tomorrow.

selkiess commented 5 years ago

@ZeroQI

Okay after ~300 episodes as a test I can confirm that the issue still persists. After looking over a few episodes it would seem that there are less bad posters. Now there is a single bad poster, then two correct posters. One being the one downloaded from you-tube, the other good one being the auto generated one.

If you want the logs I can provide them as well.

image

ZeroQI commented 5 years ago

Please

selkiess commented 5 years ago

sorry for the delay. Logs: root-YouTube.scanner.log com.plexapp.agents.youtube.log com.plexapp.agents.youtube1.log com.plexapp.agents.youtube2.log Cody'sLab.filelist.log Cody'sLab.scanner.log root-YouTube.filelist.log

Edit:

also it would seem some files did not get matched properly. For example 20130105 Chicken Thinks its a Dog [ihuxNw7EnB4].mkv matched as Year of BeeKeeping Episode 41.2, Grantsville hive update which has an id of kWjXxQIvNtw Its another video by the same uploader which is also in that season library

ZeroQI commented 5 years ago
2018-09-10 22:46:41,050 (1488845a0700) :  INFO (__init__:366) - metadata.seasons[2013].episodes[549] "20130105 Chicken Thinks its a Dog [ihuxNw7EnB4].mkv"
2018-09-10 22:46:41,050 (1488845a0700) :  INFO (__init__:389) - # videoId [ihuxNw7EnB4] not in Playlist/channel item list so loading video_details
2018-09-10 22:46:41,054 (1488845a0700) :  DEBUG (networking:166) - Requesting 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,statistics&id=ihuxNw7EnB4&key=AIzaSyCVC3zFuy2Y5Ayk2jiAheefRIW2OIlACNg'
2018-09-10 22:46:41,307 (1488845a0700) :  DEBUG (networking:166) - Requesting 'https://i.ytimg.com/vi/ihuxNw7EnB4/sddefault.jpg'
2018-09-10 22:46:41,496 (1488845a0700) :  DEBUG (networking:198) - Not caching 'https://i.ytimg.com/vi/ihuxNw7EnB4/sddefault.jpg' (content type 'image/jpeg' not cacheable in Agent plug-ins)
2018-09-10 22:46:41,497 (1488845a0700) :  INFO (__init__:402) - [ ] title:    "Chicken Thinks its a Dog"
2018-09-10 22:46:41,498 (1488845a0700) :  INFO (__init__:403) - [ ] summary:  "Or it just likes dog food and my dogs don't mind sharing."
2018-09-10 22:46:41,498 (1488845a0700) :  INFO (__init__:404) - [ ] date:     "2013-01-06T00:47:16.000Z"
2018-09-10 22:46:41,499 (1488845a0700) :  INFO (__init__:405) - [ ] rating:   "9.0"
2018-09-10 22:46:41,499 (1488845a0700) :  INFO (__init__:406) - [ ] thumbs:   "https://i.ytimg.com/vi/ihuxNw7EnB4/sddefault.jpg"
2018-09-10 22:46:41,499 (1488845a0700) :  INFO (__init__:408) - [ ] duration: "PT50S"->"None"
2018-09-10 22:46:41,500 (1488845a0700) :  INFO (__init__:413) - [ ] director: "Cody'sLab"
2018-09-10 22:46:41,501 (1488845a0700) :  INFO (__init__:421) - [ ] genres:   "[u'Education', u'Steel', u'Chain', u'Break', u'Liquid Nitrogen', u'Cold', u'Beekeeping (Interest)', u'Entertainment', u'P82A0279']"
2018-09-10 22:46:49,019 (1488845a0700) :  INFO (__init__:366) - metadata.seasons[2013].episodes[570] "20130729 Year of BeeKeeping Episode 41.2, Grantsville hive update [kWjXxQIvNtw].mkv"
2018-09-10 22:46:49,019 (1488845a0700) :  INFO (__init__:389) - # videoId [kWjXxQIvNtw] not in Playlist/channel item list so loading video_details
2018-09-10 22:46:49,027 (1488845a0700) :  DEBUG (networking:161) - Fetching 'https://www.googleapis.com/youtube/v3/videos?part=snippet,contentDetails,statistics&id=kWjXxQIvNtw&key=AIzaSyCVC3zFuy2Y5Ayk2jiAheefRIW2OIlACNg' from the HTTP cache
2018-09-10 22:46:49,037 (1488845a0700) :  DEBUG (networking:166) - Requesting 'https://i.ytimg.com/vi/kWjXxQIvNtw/sddefault.jpg'
2018-09-10 22:46:49,236 (1488845a0700) :  DEBUG (networking:198) - Not caching 'https://i.ytimg.com/vi/kWjXxQIvNtw/sddefault.jpg' (content type 'image/jpeg' not cacheable in Agent plug-ins)
2018-09-10 22:46:49,236 (1488845a0700) :  INFO (__init__:402) - [ ] title:    "Year of BeeKeeping Episode 41.2, Grantsville hive update"
2018-09-10 22:46:49,237 (1488845a0700) :  INFO (__init__:403) - [ ] summary:  "I make it back to the Grantsville hive and add a super."
2018-09-10 22:46:49,237 (1488845a0700) :  INFO (__init__:404) - [ ] date:     "2013-07-29T23:06:58.000Z"
2018-09-10 22:46:49,238 (1488845a0700) :  INFO (__init__:405) - [ ] rating:   "9.0"
2018-09-10 22:46:49,238 (1488845a0700) :  INFO (__init__:406) - [ ] thumbs:   "https://i.ytimg.com/vi/kWjXxQIvNtw/sddefault.jpg"
2018-09-10 22:46:49,238 (1488845a0700) :  INFO (__init__:408) - [ ] duration: "PT5M27S"->"None"
2018-09-10 22:46:49,239 (1488845a0700) :  INFO (__init__:413) - [ ] director: "Cody'sLab"
2018-09-10 22:46:49,239 (1488845a0700) :  INFO (__init__:421) - [ ] genres:   "[u'Education', u'Steel', u'Chain', u'Break', u'Liquid Nitrogen', u'Cold', u'Beekeeping (Interest)', u'Entertainment', u'P82A0279']"

because it is selected it is not deleted it seems, but i asked plex to remove screenshots not in the list... Plex bug i am afraid...

You have ep 549 and 570... Which episode have which data? If the ep got renumbered, it may inherit metadata already there until the agent does a full metadata refresh... Does it correct if you do a full metadata refresh for that series?

selkiess commented 5 years ago

Episode 570 matched as "Year of BeeKeeping Episode 41.2, Grantsville hive update" The actual file however is 20130105 Chicken Thinks its a Dog [ihuxNw7EnB4].mkv

Episdode 549 does not appear in the library. Episode 549 is the right match for the file currently showing up as episode 570 Year of BeeKeeping Episode 41.2, Grantsville hive update.

After refreshing the metadata all the metadata fixed itself besides the posters. For example Episode 470 now correctly identifies as Chicken Thinks its a Dog [ihuxNw7EnB4] however it still has the poster for Year of BeeKeeping Episode 41.2, Grantsville hive update

ZeroQI commented 5 years ago

if an episode jumped from one episode number to another, plex will not update and correct the metadata, only when doing a full refresh. It seems the active original poster will stay, a plex issue. I honestly cannot do much. You should really use playlist if they exist, as the episode numbering will not change over time

GlassedSilver commented 4 years ago

Can't we generate a fantasy EP number from information like upload date and the first n numerals in the file's md5 hash?

Unless of course this would probably trigger Plex to believe it's an extra/special, right?

Man, if Plex just supported letters in the episode ID there'd be a lot of things we could fix...

Youtube and anime truly are Plex' kryptonite. A software that seems incredibly easy to use and work on as long as you stay in Hollywood becomes a nightmare once you throw your niche needs at it...

Has anything changed about the situation by the way that you could workaround for that you couldn't before? I'd love to make it all work a little nicer... :(