ZeroQI / Absolute-Series-Scanner

Seasons, absolute mode, Subfolders...
1k stars 155 forks source link

Add season poster urls for tvdb4 online setup #40

Closed EndOfLine369 closed 8 years ago

EndOfLine369 commented 8 years ago

Carried over from discussion from https://github.com/ZeroQI/Absolute-Series-Scanner/pull/36

@EndOfLine369 Hmmmm....On further thought, maybe we don't want to store these images at all. I could see people complain about image rights. We could just store the URLs to the images. And still need a way for HAMA to know when the xml is used for seasons.

As xml, we can easily just add in a separate entry to not interfere with the other entries as we are searching for anime tags "/tvdb4entries/anime[@tvdbid='%s']" in ASS. EX:

  <anime tvdbid="88031" name="Dragon Ball Kai">
    01|001|016|Saiyan Saga
    02|017|054|Frieza Saga
    03|055|067|Androids Saga
    04|068|098|Cell Saga
    05|099|133|Majin Buu Saga
    06|134|159|Evil Buu Saga
  </anime>
  <posters tvdbid="88031" name="Dragon Ball Kai">
    01|[URL]
    02|[URL]
    03|[URL]
    04|[URL]
    05|[URL]
    06|[URL]
  </posters>

Would not recommend separating into separate files and that could be an issue when reconciling file entries.

@sven-7 I think the URL solution is a good compromise from a storage/rights perspective. Could we design it either way so there can be more than one per season? For example:

 <anime tvdbid="88031" name="Dragon Ball Kai">
    01|001|016|Saiyan Saga
    02|017|054|Frieza Saga
    03|055|067|Androids Saga
    04|068|098|Cell Saga
    05|099|133|Majin Buu Saga
    06|134|159|Evil Buu Saga
  </anime>
  <posters tvdbid="88031" name="Dragon Ball Kai">
    01|[URL]
    01|[URL]
  </posters>

@EndOfLine369 I don't see an issue with that to allow people different pictures available. But would probably need to make a rule for the file of only X images max per season. 2 per season?

@sven-7 Seems fair to me.

@ZeroQI

<anime tvdbid="88031" name="Dragon Ball Kai">
    01|001|016|[URL]|Saiyan Saga
    02|017|054|[URL]|Frieza Saga
    03|055|067|[URL]|Androids Saga
    04|068|098|[URL]|Cell Saga
    05|099|133|[URL]|Majin Buu Saga
    06|134|159|[URL]|Evil Buu Saga
  </anime>

I thought you did the posters yourself... If thetvdb have them yes a link will be great

Would not recommend separating into separate files and that could be an issue when reconciling file entries.

@EndOfLine369 "Would not recommend separating into separate files and that could be an issue when reconciling file entries." I had already mentioned that or are you meaning separate entries in the file?

If we combined the 'anime' & 'poster' tags, we could not have more than one poster available for a season. I would prefer not all to be in one entry as the url will make the line exceedingly long and would think is best to keep the 'anime' entry same as the local 'tvdb4.mapping' file's content.

@ZeroQI The poster is done by the agent so technically no need for a single file having both but it's simpler...

We could have a variable number of arguments, the format stays compatible and allows local file to specify poster link too...

<anime tvdbid="88031" name="Dragon Ball Kai">
    01|001|016|Saiyan Saga|[URL]|[URL]
    02|017|054|Frieza Saga|[URL]|[URL]|[URL]
    03|055|067|Androids Saga|[URL]
    04|068|098|Cell Saga|[URL]|[URL]
    05|099|133|Majin Buu Saga|[URL]|[URL]|[URL]
    06|134|159|Evil Buu Saga|[URL]|[URL]
  </anime>

The tvdb id would be unique so i don't think there will be issues reconciliating entries, like what we do with the xml mapping file from scudlee's... single file easier to maintain...

tvdb4.posters.xml
 <posters tvdbid="88031" name="Dragon Ball Kai">
    01|[URL]
    01|[URL]
    02|[URL]
    02|[URL]
    03|[URL]
    04|[URL]
    05|[URL]
    06|[URL]
  </posters>

Opinions?

EndOfLine369 commented 8 years ago

@ZeroQI "If thetvdb have them yes a link will be great" Are you only thinking about allowing urls from thetvdb posters?

And on the files, if you disagree on putting separate 'anime' and 'poster' xml entries right next to each other in the same file, I would go with option 2 of a separate 'tvdb4.posters.xml' as it would just make a mess of long lines when trying to read season mappings on adding in urls to the end (brain set on word wrap).

ZeroQI commented 8 years ago

any posters but tvdb ones have fixed high res and look nicer The season posters you have in your screenshot, they come from thetvdb season posters ? would prefer 2 files as they look nicer and the scanner doens't need the url but updating a single file is easier...

EndOfLine369 commented 8 years ago

Just wanted to make sure you were not opposed to anything other then tvdb posters. Those posters were from Trakt's seasons. Actually found some good ones on themoviedb just now.

01|https://image.tmdb.org/t/p/original/6WtCy228qbkpW5Eo71akpI8XJKi.jpg 02|https://image.tmdb.org/t/p/original/2o9tF5qIXVIc6cKV2uSLhXQyVox.jpg 03|https://image.tmdb.org/t/p/original/lvMz2kyfZ9K08EyHa57T1rah900.jpg 04|https://image.tmdb.org/t/p/original/25rCwuPit2QlgLJ31Jdu6eKOXit.jpg 05|https://image.tmdb.org/t/p/original/jDcTbOo2SOL7GH6tC7rRYzr2A2B.jpg 06|https://image.tmdb.org/t/p/original/wTccnUmJPEJXQQqjFfWNHTDcm8W.jpg 01|https://image.tmdb.org/t/p/original/aBFXBZugTCfnIDQTYl4vAoP9jE4.jpg 02|https://image.tmdb.org/t/p/original/3wj0YJWY8B3pzfvfk3tGXs4OQdc.jpg 03|https://image.tmdb.org/t/p/original/56mZEizhYsTwmtEkGDwWZfadYXq.jpg 04|https://image.tmdb.org/t/p/original/cQWHSKlZjQgXbRwtm7x1o6esW7v.jpg 01|https://walter.trakt.us/images/seasons/000/024/495/posters/original/53d58090f9.jpg 02|https://walter.trakt.us/images/seasons/000/024/497/posters/original/6a6c3f82a6.jpg 03|https://walter.trakt.us/images/seasons/000/024/498/posters/original/cd8aea9289.jpg 04|https://walter.trakt.us/images/seasons/000/024/499/posters/original/c8fc2e5e36.jpg 04|https://walter.trakt.us/images/seasons/000/024/500/posters/original/892d9a4b8f.jpg 05|https://walter.trakt.us/images/seasons/000/024/502/posters/original/a28d0ef148.jpg 06|https://walter.trakt.us/images/seasons/000/024/503/posters/original/a11d4d9c36.jpg

Yes, I broke the above statement of 2 max a season. Meh. :grin:

ZeroQI commented 8 years ago

The point is to have posters with the saga named. Your screencap was superb in that regard We can add all tvdb season posters with lower id as second choice On 17 Jun 2016 17:27, "EndOfLine369" notifications@github.com wrote:

Just wanted to make sure you were not opposed to anything other then tvdb posters. Those posters were from Trakt's seasons. Actually found some good ones on themoviedb just now.

01|https://image.tmdb.org/t/p/original/6WtCy228qbkpW5Eo71akpI8XJKi.jpg 01|https://image.tmdb.org/t/p/original/aBFXBZugTCfnIDQTYl4vAoP9jE4.jpg 01|https://walter.trakt.us/images/seasons/000/024/495/posters/thumb/53d58090f9.jpg 02|https://image.tmdb.org/t/p/original/2o9tF5qIXVIc6cKV2uSLhXQyVox.jpg 02|https://image.tmdb.org/t/p/original/3wj0YJWY8B3pzfvfk3tGXs4OQdc.jpg 02|https://walter.trakt.us/images/seasons/000/024/497/posters/thumb/6a6c3f82a6.jpg 03|https://image.tmdb.org/t/p/original/lvMz2kyfZ9K08EyHa57T1rah900.jpg 03|https://image.tmdb.org/t/p/original/56mZEizhYsTwmtEkGDwWZfadYXq.jpg 03|https://walter.trakt.us/images/seasons/000/024/498/posters/thumb/cd8aea9289.jpg 04|https://image.tmdb.org/t/p/original/25rCwuPit2QlgLJ31Jdu6eKOXit.jpg 04|https://image.tmdb.org/t/p/original/cQWHSKlZjQgXbRwtm7x1o6esW7v.jpg 04|https://walter.trakt.us/images/seasons/000/024/499/posters/thumb/c8fc2e5e36.jpg 04|https://walter.trakt.us/images/seasons/000/024/500/posters/thumb/892d9a4b8f.jpg 05|https://image.tmdb.org/t/p/original/jDcTbOo2SOL7GH6tC7rRYzr2A2B.jpg 05|https://walter.trakt.us/images/seasons/000/024/502/posters/thumb/a28d0ef148.jpg 06|https://image.tmdb.org/t/p/original/wTccnUmJPEJXQQqjFfWNHTDcm8W.jpg 06|https://walter.trakt.us/images/seasons/000/024/503/posters/thumb/a11d4d9c36.jpg

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-226815972, or mute the thread https://github.com/notifications/unsubscribe/AE7LZWchVk7JH-b4C3Hdbm4oxo6WkoC3ks5qMsrogaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

Created the new file and put in the example & DB Kai entry.

So the mystery that needs to be solved now is how ASS can signal HAMA that the tvdb4 mode option was the online xml option 3.

ZeroQI commented 8 years ago

You need the tvdbid so hama sets the right guid. Only the first time will hama know if you pass info on the serie name as it will change it which is ok only for the guid as it remains. We can load the tvdb4 season poster file in all situations not only online file... On 18 Jun 2016 02:21, "EndOfLine369" notifications@github.com wrote:

I guess we could update 'folder_show' with '[tvdb4-option3]'...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-226913697, or mute the thread https://github.com/notifications/unsubscribe/AE7LZVZX576rZyukOzkh17HZ9j5yF7muks5qM0gygaJpZM4I39ZB .

ZeroQI commented 8 years ago

But saga won't match got it now... We need to test if season folders or online mapping then... or make guid with more info... On 18 Jun 2016 06:45, "benjamin brisson" benjamin.brisson@gmail.com wrote:

You need the tvdbid so hama sets the right guid. Only the first time will hama know if you pass info on the serie name as it will change it which is ok only for the guid as it remains. We can load the tvdb4 season poster file in all situations not only online file... On 18 Jun 2016 02:21, "EndOfLine369" notifications@github.com wrote:

I guess we could update 'folder_show' with '[tvdb4-option3]'...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-226913697, or mute the thread https://github.com/notifications/unsubscribe/AE7LZVZX576rZyukOzkh17HZ9j5yF7muks5qM0gygaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

@ZeroQI Re first reply: Yep, found that out while trying to code it as 'metadata.title' will only contain it as initial load only.

Re second reply: I'll actually be counting the existing seasons with the season count in 'tvdb4.mapping.xml' and load posters if the match.

ZeroQI commented 8 years ago

Clever, do not count season 0 though Night be worth checking eps range but not mandatory.

Good thinking On 18 Jun 2016 07:31, "EndOfLine369" notifications@github.com wrote:

@ZeroQI https://github.com/ZeroQI Re first reply: Yep, found that out while trying to code it as 'metadata.title' will only contain it as initial load only.

Re first reply: I'll actually be counting the existing seasons with the season count in 'tvdb4.mapping.xml' and load posters if the match.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-226925308, or mute the thread https://github.com/notifications/unsubscribe/AE7LZXDiKbPkRtqRh4JdF_RJ_qwBW3Z8ks5qM5DOgaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

Just going to look for max season in both. Crap, just thought about what if they don't have the episodes available for all the seasons.... In their Plex.

ZeroQI commented 8 years ago

Well 2 solutions Check tvdb4 if season folder not present and no local mapping file Or Check mapping file and check ep mapping range for season posters.

You could use loop for physical files to check if in range and set tvdb4_season[season] to 1 if didn't exist and in range and 0 if not in range regardleas if it didn't exist or not. Once 0 cannot become 1 again... Could then deal with seasons afterwards. We could load normal tvdb season posters with highter priority id number to lower the actual priority... On 18 Jun 2016 07:44, "EndOfLine369" notifications@github.com wrote:

In their Plex.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-226925737, or mute the thread https://github.com/notifications/unsubscribe/AE7LZVUBfHYQPub7A3zNl2NfaUu_FcnUks5qM5O2gaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

The understanding of the how in what you just said is escaping me at the moment. I think i've been up too long. It is not tested. Still roughing out the code and expected behavior. Here is what I have so far: "DefaultPrefs.json" https://gist.github.com/EndOfLine369/329a66439a5e20248c3bf8d0a46ce4bc ) Addition of 'GetASSPosters' "init.py" https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc ) Replacement of all the 'metadata.id...' with variables to stop the constant 'split', 'startswith', & 'id[x:]' calls. ) Addition of 'GetASSPosters' ) Addition of 'def getImagesFromASS'

EndOfLine369 commented 8 years ago

Got a working version into Gist. It will load the ASS posters on any tvdb4 mode at this time. "DefaultPrefs.json" https://gist.github.com/EndOfLine369/329a66439a5e20248c3bf8d0a46ce4bc "init.py" https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc

You will need to check the option for ASS posters if you want them to be loaded in. Default is False.

image

image

image

EndOfLine369 commented 8 years ago

@ZeroQI No idea how to do your "2 solutions" as HAMA has no idea on the physical files. Only ASS knows that unless i'm unaware of some data available to HAMA.

EndOfLine369 commented 8 years ago

@ZeroQI Any idea on why the not cacheable in Agent plug-ins is happening on both the xml and all the images it loads in?

2016-06-19 09:42:53,848 (-b675470) :  DEBUG (networking:166) - Requesting 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 09:42:53,973 (-b675470) :  DEBUG (networking:198) - Not caching 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' (content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins)
2016-06-19 09:42:53,974 (-b675470) :  DEBUG (__init__:697) - getImagesFromASS() - Loaded poster XML: 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 09:42:54,029 (-b675470) :  DEBUG (networking:166) - Requesting 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg'
2016-06-19 09:42:54,837 (-b675470) :  DEBUG (networking:198) - Not caching 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg' (content type 'image/jpeg' not cacheable in Agent plug-ins)
2016-06-19 09:42:54,868 (-b675470) :  DEBUG (__init__:789) - metadata_download() - url: 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg', num: '1', filename: 'TVDB/seasons/252322-1-Hunter_Exam_Arc.jpg'
ZeroQI commented 8 years ago

Pictures are never cacheable. Xml should. When you load the xml you give the cache time period On 19 Jun 2016 15:47, "EndOfLine369" notifications@github.com wrote:

@ZeroQI https://github.com/ZeroQI Any idea on why the not cacheable in Agent plug-ins is happening on both the xml and all the images it loads in?

2016-06-19 09:42:53,848 (-b675470) : DEBUG (networking:166) - Requesting 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' 2016-06-19 09:42:53,973 (-b675470) : DEBUG (networking:198) - Not caching 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' (content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins) 2016-06-19 09:42:53,974 (-b675470) : DEBUG (init:697) - getImagesFromASS() - Loaded poster XML: 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' 2016-06-19 09:42:54,029 (-b675470) : DEBUG (networking:166) - Requesting 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg' 2016-06-19 09:42:54,837 (-b675470) : DEBUG (networking:198) - Not caching 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg' (content type 'image/jpeg' not cacheable in Agent plug-ins) 2016-06-19 09:42:54,868 (-b675470) : DEBUG (init:789) - metadata_download() - url: 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg', num: '1', filename: 'TVDB/seasons/252322-1-Hunter_Exam_Arc.jpg'

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-227001162, or mute the thread https://github.com/notifications/unsubscribe/AE7LZTgc1TaQjT8cZmPD-Xs9KYTMyck8ks5qNVaKgaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

Nvm on the images. Seems like it only posts that on the initial load probably as it has the file locally now. But xml is still no idea on the xml not caching...

2016-06-19 09:57:56,638 (-b675470) :  DEBUG (networking:166) - Requesting 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 09:57:56,951 (-b675470) :  DEBUG (networking:198) - Not caching 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' (content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins)
2016-06-19 09:57:56,952 (-b675470) :  DEBUG (__init__:697) - getImagesFromASS() - Loaded poster XML: 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 09:57:56,953 (-b675470) :  DEBUG (__init__:790) - metadata_download() - url: 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg', num: '1', filename: 'TVDB/seasons/252322-1-Hunter_Exam_Arc.jpg'*
2016-06-19 09:57:56,954 (-b675470) :  DEBUG (__init__:790) - metadata_download() - url: 'http://vignette3.wikia.nocookie.net/hunterxhunter/images/2/26/Zoldyck_Family_members.png', num: '2', filename: 'TVDB/seasons/252322-2-Zoldyck_Family_members.png'*
...
2016-06-19 09:57:56,957 (-b675470) :  DEBUG (__init__:790) - metadata_download() - url: 'http://vignette2.wikia.nocookie.net/hunterxhunter/images/f/f1/13th_Hunter_Chairman_Election_arc_2011.png', num: '7', filename: 'TVDB/seasons/252322-7-13th_Hunter_Chairman_Election_arc_2011.png'*
2016-06-19 09:57:56,971 (-b675470) :  DEBUG (networking:161) - Fetching 'http://thetvdb.com/api/A27AD9BE0DA63333/series/252322/banners.xml' from the HTTP cache
2016-06-19 09:57:56,984 (-b675470) :  DEBUG (__init__:713) - getImagesFromTVDB() - Loaded picture XML: 'http://thetvdb.com/api/A27AD9BE0DA63333/series/252322/banners.xml'
2016-06-19 09:57:56,989 (-b675470) :  DEBUG (__init__:790) - metadata_download() - url: 'http://thetvdb.com/banners/fanart/original/252322-14.jpg', num: '2', filename: 'TVDB/fanart/original/252322-14.jpg'*

Its the same code as TVDB's 'banners.xml' pull.

    try:     postersXml = XML.ElementFromURL( ASS_POSTERS_URL, cacheTime=CACHE_1HOUR * 24) # don't bother with the full zip, all we need is the banners
    except:  Log.Debug("getImagesFromASS() - Loading poster XML failed: " + ASS_POSTERS_URL); return
    else:    Log.Debug("getImagesFromASS() - Loaded poster XML: '%s'" % ASS_POSTERS_URL)
...
    try:     bannersXml = XML.ElementFromURL( TVDB_BANNERS_URL % tvdbid, cacheTime=CACHE_1HOUR * 24) # don't bother with the full zip, all we need is the banners
    except:  Log.Debug("getImagesFromTVDB() - Loading picture XML failed: " + TVDB_BANNERS_URL % tvdbid);  return
    else:    Log.Debug("getImagesFromTVDB() - Loaded picture XML: '%s'" % (TVDB_BANNERS_URL % tvdbid))
ZeroQI commented 8 years ago

The message says content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins) Save the xml in something else than utf8 and try agai On 19 Jun 2016 16:06, "EndOfLine369" notifications@github.com wrote:

Nvm on the images. Seems like it only posts that on the initial load probably as it has the file locally now. But xml is still no idea on the xml not caching...

2016-06-19 09:57:56,638 (-b675470) : DEBUG (networking:166) - Requesting 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' 2016-06-19 09:57:56,951 (-b675470) : DEBUG (networking:198) - Not caching 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' (content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins) 2016-06-19 09:57:56,952 (-b675470) : DEBUG (init:697) - getImagesFromASS() - Loaded poster XML: 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' 2016-06-19 09:57:56,953 (-b675470) : DEBUG (init:790) - metadata_download() - url: 'http://vignette4.wikia.nocookie.net/hunterxhunter/images/8/89/Hunter_Exam_Arc.jpg', num: '1', filename: 'TVDB/seasons/252322-1-Hunter_Exam_Arc.jpg' 2016-06-19 09:57:56,954 (-b675470) : DEBUG (init:790) - metadata_download() - url: 'http://vignette3.wikia.nocookie.net/hunterxhunter/images/2/26/Zoldyck_Family_members.png', num: '2', filename: 'TVDB/seasons/252322-2-Zoldyck_Family_members.png' ... 2016-06-19 09:57:56,957 (-b675470) : DEBUG (init:790) - metadata_download() - url: 'http://vignette2.wikia.nocookie.net/hunterxhunter/images/f/f1/13th_Hunter_Chairman_Election_arc_2011.png', num: '7', filename: 'TVDB/seasons/252322-7-13th_Hunter_Chairman_Election_arc_2011.png' 2016-06-19 09:57:56,971 (-b675470) : DEBUG (networking:161) - Fetching 'http://thetvdb.com/api/A27AD9BE0DA63333/series/252322/banners.xml' from the HTTP cache 2016-06-19 09:57:56,984 (-b675470) : DEBUG (init:713) - getImagesFromTVDB() - Loaded picture XML: 'http://thetvdb.com/api/A27AD9BE0DA63333/series/252322/banners.xml' 2016-06-19 09:57:56,989 (-b675470) : DEBUG (init:790) - metadata_download() - url: 'http://thetvdb.com/banners/fanart/original/252322-14.jpg', num: '2', filename: 'TVDB/fanart/original/252322-14.jpg'

Its the same code as TVDB's 'banners.xml' pull.

try:     postersXml = XML.ElementFromURL( ASS_POSTERS_URL, cacheTime=CACHE_1HOUR * 24) # don't bother with the full zip, all we need is the banners
except:  Log.Debug("getImagesFromASS() - Loading poster XML failed: " + ASS_POSTERS_URL); return
else:    Log.Debug("getImagesFromASS() - Loaded poster XML: '%s'" % ASS_POSTERS_URL)

... try: bannersXml = XML.ElementFromURL( TVDB_BANNERS_URL % tvdbid, cacheTime=CACHE_1HOUR * 24) # don't bother with the full zip, all we need is the banners except: Log.Debug("getImagesFromTVDB() - Loading picture XML failed: " + TVDB_BANNERS_URL % tvdbid); return else: Log.Debug("getImagesFromTVDB() - Loaded picture XML: '%s'" % (TVDB_BANNERS_URL % tvdbid))

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-227002085, or mute the thread https://github.com/notifications/unsubscribe/AE7LZZBiBo0cxcXJOsy5NWXffhyQsX4kks5qNVrdgaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

@ZeroQI Looks like I had to change it to non-https and it loads and caches. Please be aware of the below code issues when you look on the https ticket.

Works - http://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml

2016-06-19 10:32:34,819 (-ba70470) :  DEBUG (networking:161) - Fetching 'http://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' from the HTTP cache
2016-06-19 10:32:34,832 (-ba70470) :  DEBUG (__init__:697) - getImagesFromASS() - Loaded poster XML: 'http://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'

Failed to load - https://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml

2016-06-19 10:26:02,484 (-b5b7470) :  DEBUG (networking:166) - Requesting 'https://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 10:26:02,610 (-b5b7470) :  DEBUG (__init__:696) - getImagesFromASS() - Loading poster XML failed: https://rawgithub.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml

Loads but would not cache : https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml

2016-06-19 09:57:56,638 (-b675470) :  DEBUG (networking:166) - Requesting 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml'
2016-06-19 09:57:56,951 (-b675470) :  DEBUG (networking:198) - Not caching 'https://raw.githubusercontent.com/ZeroQI/Absolute-Series-Scanner/master/tvdb4.posters.xml' (content type 'text/plain; charset=utf-8' not cacheable in Agent plug-ins)
ZeroQI commented 8 years ago

There is variation in the header "Loads but would not cache" adds the following: "<?xml version="1.0" encoding="utf-8"?>" If you put explicitely this header in the file without utf-8 encoding it should cache

EndOfLine369 commented 8 years ago

@ZeroQI any thoughts on how to tell if it used the web xml? Otherwise, I think it works fine and will load the posters if source is tvdb4 and users have enabled the GetASSPosters option.

ZeroQI commented 8 years ago

@EndOfLine369: We can check if there is a local mapping file or season folders, and if not, it had to be online. Local mapping file is easy to check (use scanner code with root path and file path going one depth in the serie folder, then check Extras/xxx.id) and counting the folder depth between an episode filepath and the root folders is also easy (remove the root path from the first file path, then explode the path in an list and count the numbers of items in it).

EndOfLine369 commented 8 years ago

@ZeroQI As mentioned above, I do not know how to do this with data I understand available to the agent as HAMA has no idea on the physical files. Please enlighten me if it is. What i'm thinking about doing is making the scanner put the source to tvdb43 for mode 4 option 3.

ZeroQI commented 8 years ago

Hama does access files here:

for media_item in media.seasons[media_season].episodes[media_episode].items: for item_part in media_item.parts: Log("File: '%s' '%s'" % (ep, item_part.file))

Local media assets agent https://github.com/plexinc-agents/LocalMedia.bundle/blob/master/Contents/Code/__init__.py

path = os.path.dirname(media.items[0].parts[0].file) for p in os.listdir(path): path_files[p.lower()] = p Give path of first part of first media file...

EndOfLine369 commented 8 years ago

Nice

EndOfLine369 commented 8 years ago

Got it I believe.

    try:
      s = media.seasons.keys()[0]
      e = media.seasons[s].episodes.keys()[0]
      dir_path = os.path.dirname(media.seasons[s].episodes[e].items[0].parts[0].file)
      dir_name = os.path.basename(dir_path)
      if    "[tvdb4-" not in dir_name and "tvdb4.id" not in os.listdir(dir_path): Log.Debug("getImagesFromASS() - Files are in a season folder (option 1)"); return
      elif  "tvdb4.mapping" in os.listdir(dir_path): Log.Debug("getImagesFromASS() - Files are in the series folder and has a mapping file (option 2)"); return
      else: Log.Debug("getImagesFromASS() - Files are in the series folder and has no mapping file (option 3)")
    except Exception as e:  
      Log.Error("getImagesFromASS() - Issues in finding setup info as directories have most likely changed post scan into Plex")
      Log.Error(e); return

Gist updated https://gist.github.com/EndOfLine369/8ee08c812a5f3943e6cc

ZeroQI commented 8 years ago
try:
      s, e = media.seasons.keys()[0], media.seasons[s].episodes.keys()[0]
      dir_path, dir_name, dir_list = os.path.dirname(media.seasons[s].episodes[e].items[0].parts[0].file), os.path.basename(dir_path), os.listdir(dir_path)
      if    "[tvdb4-" not in dir_name and "tvdb4.id" not in dir_list:  Log.Debug("getImagesFromASS() - Files are in a season folder (option 1)"); return
      elif  "tvdb4.mapping" in dir_list:                               Log.Debug("getImagesFromASS() - Files are in the series folder and has a mapping file (option 2)"); return
      else:                                                            Log.Debug("getImagesFromASS() - Files are in the series folder and has no mapping file (option 3)")
    except Exception as e:  
      Log.Error("getImagesFromASS() - Issues in finding setup info as directories have most likely changed post scan into Plex"); Log.Error(e); return

Nice code :D I think we should remove "Extras" folder possibility from tvdbx.id files

EndOfLine369 commented 8 years ago

Can't do the variable reductions as all variables are evaluated at the same time so evaluation would throw an error as 's' & 'dir_path' are unknown at the time. EX:

>>> s, e = "qwe", s+"asd"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 's' is not defined

>>> dir_path, dir_name, dir_list = "/tmp", os.path.basename(dir_path), os.listdir(dir_path)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'dir_path' is not defined

So this could only be reduced too:

    try:
      s = media.seasons.keys()[0]
      e = media.seasons[s].episodes.keys()[0]
      dir_path = os.path.dirname(media.seasons[s].episodes[e].items[0].parts[0].file)
      dir_name, dir_list = os.path.basename(dir_path), os.listdir(dir_path)
      if    "[tvdb4-" not in dir_name and "tvdb4.id" not in dir_list: Log.Debug("getImagesFromASS() - Files are in a season folder (option 1)"); return
      elif  "tvdb4.mapping" in dir_list:                              Log.Debug("getImagesFromASS() - Files are in the series folder and has a mapping file (option 2)"); return
      else:                                                           Log.Debug("getImagesFromASS() - Files are in the series folder and has no mapping file (option 3)")
    except Exception as e:  
      Log.Error("getImagesFromASS() - Issues in finding setup info as directories have most likely changed post scan into Plex"); Log.Error(e); return

I do not object the removal of checking the 'Extras' folder when looking for the id files in ASS.

ZeroQI commented 8 years ago

My bad, missed that one. I am still am a fan of aligning the Log.debug, much clearer :D

I thought it was cleaner to hide files, but don't think anybody actually uses it and will make things cleaner

EndOfLine369 commented 8 years ago

Just to confirm we are talking about the same thing. I'm going to change ASS:

FROM:
    for file in ("anidb.id", "Extras/anidb.id", "tvdb.id", "Extras/tvdb.id", "tvdb2.id", "Extras/tvdb2.id", "tvdb3.id", "Extras/tvdb3.id", "tvdb4.id", "Extras/tvdb4.id", "tmdb.id", "Extras/tmdb.id", "tsdb.id", "Extras/tsdb.id", "imdb.id", "Extras/imdb.id"):

TO:
    for file in ("anidb.id", "tvdb.id", "tvdb2.id", "tvdb3.id", "tvdb4.id", "tmdb.id", "tsdb.id", "imdb.id"):
ZeroQI commented 8 years ago

Yes exactly. Makes things simpler On 23 Jun 2016 19:02, "EndOfLine369" notifications@github.com wrote:

Just to confirm we are talking about the same thing. I'm going to change ASS:

FROM: for file in ("anidb.id", "Extras/anidb.id", "tvdb.id", "Extras/tvdb.id", "tvdb2.id", "Extras/tvdb2.id", "tvdb3.id", "Extras/tvdb3.id", "tvdb4.id", "Extras/tvdb4.id", "tmdb.id", "Extras/tmdb.id", "tsdb.id", "Extras/tsdb.id", "imdb.id", "Extras/imdb.id"): TO: for file in ("anidb.id", "tvdb.id", "tvdb2.id", "tvdb3.id", "tvdb4.id", "tmdb.id", "tsdb.id", "imdb.id"):

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ZeroQI/Absolute-Series-Scanner/issues/40#issuecomment-228132346, or mute the thread https://github.com/notifications/unsubscribe/AE7LZQJ3IXpvm9iH4GutBO8MeHRiMq0pks5qOspIgaJpZM4I39ZB .

EndOfLine369 commented 8 years ago

ASS updated

EndOfLine369 commented 8 years ago

Updated the readme as well https://github.com/ZeroQI/Absolute-Series-Scanner/commit/095e4f8df8b1732e285aaeeace806139c22136d4

EndOfLine369 commented 8 years ago

Also removed the checking of the related "Extras/tvdb4.mapping" file to get rid of all of the "Extras" dir checks.

ZeroQI commented 8 years ago

Thanks a lot.

Further code reduction [down to 407 lines]: . removed seasonsfromfolder file . removed zerofilesize file . abs_manual_placement_worked replaced by else . urrlib python 3 included

Please review and test https://gist.github.com/ZeroQI/974f6335ad4f31ecdfe1e4af0404098d

Talking about improvements, i can't think of other changes... the tvdb4 mode allow single season with tvdb numbering for specials, which if multiple movies are present is super cool.

support media stubs http://kodi.wiki/view/Media_stubs ?

There is an AMV agent (which the author calls scanner for some reason) here https://forums.plex.tv/discussion/123409/anime-music-videos-amvs-scanner was thinking of rewriting but thought demand was too low for that...

Was thinking of a separate scanner for game roms or ps3 ps4 disks but only if the site have front cover scans

|     NETWORK     |  GAMES  | API | ALL PLATFORMS |Allowed commercially|
|-----------------|---------|-----|---------------|--------------------|
|  giantbomb.com  |  49532  |  Y  |       Y       |       N            |
| thegamesdb.net  |  34911  |  Y  |       Y       |       N            |
|    igdb.com     |  18157  |  Y  |       Y       |       Y            |
|  vgcollect.com  |  96725  |  N  |       Y       |       N            |
|  mobygames.com  |  55278  |  N  |       Y       |       N            |
|    ugdb.com     |  49875  |  N  |       Y       |       N            |
| gamesdbase.com  |  39821  |  N  |       Y       |       N            |
|    spong.com    |  33207  |  N  |       Y       |       N            |
|   archive.vg    |  15114  |  N  |       N       |       N            |

http://www.giantbomb.com/api/documentation http://www.giantbomb.com/api/game/3030-4725/?http://www.giantbomb.com/api/game/3030-4725/?api_key=76a9e692eb38ad00c59ec2a88976d779988192f8&format=json&field_list=image,name,id,genres,original_game_rating,original_release_date

EndOfLine369 commented 8 years ago

Code update from this ticket has been committed "DefaultPrefs.json" ) Addition of 'GetASSPosters' https://github.com/ZeroQI/Hama.bundle/commit/e6150877ff4d350371fe6da701cc798e012bf0d7 "init.py" ) Replacement of all the 'metadata.id...' with variables to stop the constant 'split', 'startswith', & 'id[x:]' calls. https://github.com/ZeroQI/Hama.bundle/commit/605ffc7267219c71d3aa1c8a08d5d1b7924cab15 ) Addition of 'GetASSPosters' & 'def getImagesFromASS' https://github.com/ZeroQI/Hama.bundle/commit/5a8e19a0553734d18029d2d2b7222287f1838d32 https://github.com/ZeroQI/Hama.bundle/commit/3f9bbe592eafaca7906c2c52d16f3369fc83ad8c

sven-7 commented 8 years ago

Sidebar -- @EndOfLine369 where did you get the last two seasons of DB Kai? I noticed I only have through Cell, not the two Buu ones.

EndOfLine369 commented 8 years ago

I don't have that just yet. Hi10 is the only one I have found to have been done. Been trying to find how to get it without creating an account on their site. Anime: Dragon Ball Kai (2014)

sven-7 commented 8 years ago

I signed up. Here's a magnet link: magnet:?xt=urn:btih:eb0848de84375482e0bba2ea012370a2decc0908&dn=%5bHi10%5d_DragonBall-Kai%5b720p%5d&tr=http%3a%2f%2fanisaishuu.de%3a2710%2fannounce&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.openbittorrent.com%2fannounce&tr=udp%3a%2f%2fopen.demonii.com%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.publicbt.com%2fannounce&tr=udp%3a%2f%2ftracker.istole.it%3a80%2fannounce

EndOfLine369 commented 8 years ago

tyvm :smiling_imp:

EndOfLine369 commented 8 years ago

Everything has been pushed for this ticket. @sven-7 have you had to test this piece? If so and good, will close this ticket. make sure you update your json file and that you also enable the option in the edit library agent pref area.

EndOfLine369 commented 8 years ago

Mwahaha. ty again. And also shows no missing episodes now. image And note, i'm using exactly what is currently committed to the master.

EndOfLine369 commented 8 years ago

@ZeroQI, please put your reduction into a pull request. That way I can easily make fixes/adjustments and can handle any commits that happen to the master while review/testing is in-progress. There are a couple of commits that will need to be adjusted in your gist.

For the other mentions, i'll mull over them.

ZeroQI commented 8 years ago

@EndOfLine369, https://github.com/ZeroQI/Absolute-Series-Scanner/pull/45 created.

MagellanSails commented 8 years ago

I've only tried with one series so far, HxH, but the mappings to the tvdb4 defined seasons are working and I am getting the correct metadata for each episode. I was going to mention that the poster were not showing up correctly, but re-reading this whole thread I missed the "fetch posters" checkbox.

I will try again later tonight / tomorrow morning and report back, but it's looking good so far.

EndOfLine369 commented 8 years ago

Cool. Yeah, as Plex would be downloading images from other sources people should opt the ok to do that.

image

EndOfLine369 commented 8 years ago

@MagellanSails haven't heard back. Hope that means everything is working fine post enabling the agent option. Will be closing out this ticket in the next day or two.

sven-7 commented 8 years ago

This is working well for me.

MagellanSails commented 8 years ago

@EndOfLine369 Sorry, I've been busy with a lot of other things and haven't been able to work on plex much lately... I'm still having issues with the posters but I'm thinking I've mixed up files from different commits, have permissions issues, or have done something similar. Everything else is working for me though, and it sounds like it works for everyone else, so I would vote to close this.

If I discover a real issue once I have some more time to take a good look at things I'll just report a bug.

EndOfLine369 commented 8 years ago

Sounds good to me :grin: