Code Monkey home page Code Monkey logo

Comments (11)

mstrelan avatar mstrelan commented on May 11, 2024

Hoping that this can make it easy - http://pypi.python.org/pypi/python-itunes/1.0

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on May 11, 2024

This should be doable, I'll have to take some time to familiarize myself with what data iTunes provides but I imagine this wouldn't be hard to implement.

from sickbeard_mp4_automator.

mstrelan avatar mstrelan commented on May 11, 2024

I've had a further look at the iTunes API, and the Python script. The script doesn't deal with tv shows at all, but we can use the generic search function. The iTunes API doesn't seem to have an option to search for an individual episode. The smallest result set I could find is a list of all episodes in a season. Example URL below:

from sickbeard_mp4_automator.

mstrelan avatar mstrelan commented on May 11, 2024

I've had a further look at the iTunes API, and the Python script. The script doesn't deal with tv shows at all, but we can use the generic search function. The iTunes API doesn't seem to have an option to search for an individual episode. The smallest result set I could find is a list of all episodes in a season. Example URL below:
http://itunes.apple.com/search?term=Breaking+Bad+Season+5&media=tvShow&entity=tvEpisode&attribute=tvSeasonTerm&limit=200

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on May 11, 2024

Using that iTunes API here is a quick query that seems to return some metadata. I don't know if iTunes metadata is much less complete than TVDB, as I don't see any other useful results in the XML file.

import itunes

show = "Futurama"
season = 1
episode = 1

q = show + ", Season " + str(season)

items = itunes.search(q, 'tvShow', 'tvEpisode', 'tvSeasonTerm')
for item in items:
    if item.get_disc_number() == episode:
        print item.get_name()
        print item.get_short_desc()
        print item.get_long_desc()
        print item.get_artwork_url()
        print item.get_release_date()

I had to fork that project and add some functionality to be able to pull down most of the TV show parameters that we'd be interested in.

Here is the fork:
https://github.com/mdhiggins/python-itunes

from sickbeard_mp4_automator.

mstrelan avatar mstrelan commented on May 11, 2024

Awesome, I'll have a bit of a look at this shortly. FYI on GitHub you can submit a "pull request" to the author of python-itunes to merge your changes back in to the original project. He might decline but I can't imagine why.

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on May 11, 2024

That's a cool feature, once we've got queries for all the metadata that would be a good idea

from sickbeard_mp4_automator.

mstrelan avatar mstrelan commented on May 11, 2024

It seems pretty lame that the API only returns a 100x100 pixel image, eg http://a452.phobos.apple.com/us/r1000/032/Video/77/84/40/mzl.hdvcjrps.100x100-75
.jpg

If I go to https://itunes.apple.com/au/tv-season/futurama-season-2/id285627519 and get the image URL it is http://a3.mzstatic.com/us/r1000/020/Features/77/84/40/dj.gfrsozhq.170x170-75.jpg which is 170x170.

I can then strip the 170x170-75 from the URL to get the full image which is 1250x1253 px - http://a3.mzstatic.com/us/r1000/020/Features/77/84/40/dj.gfrsozhq.jpg

There doesn't seem to be a way to do that using the URL that the API returns. I suppose you could replace the domain name with http://a3.mzstatic.com/ and then strip the dimensions / quality but I'm not sure if that will work consistently or not.

from sickbeard_mp4_automator.

mstrelan avatar mstrelan commented on May 11, 2024

The CDN seems to work for a1-8, eg a1.mzstatic.com through a8.mzstatic.com. I tested it on a few different shows including Futurama, Breaking Bad, Arrested Development and New Girl.

I did also find another issue with iTunes API. Sometimes it returns another collection when you search for a season. Eg searching for Breaking Bad, Season 2 returns exactly that PLUS "Breaking Bad, Deluxe Edition: Seasons 1 & 2". I would imagine most of the time the first lot of results would be more accurate, so if we do use this we need to put in checks to ignore the other collections.

I'm starting to think the metadata from iTunes is pretty sucky, but I think I would still like to be able to get the artwork.

from sickbeard_mp4_automator.

mdhiggins avatar mdhiggins commented on May 11, 2024

I think it might be more reliable to just put an option to pull the artwork from iTunes and leave the rest of the metadata from theTVDB. I already implemented better tagging for iTunes (which let me know if those are working better for you cause I don't use iTunes). A lot of the info is missing from the iTunes source anyway.

from sickbeard_mp4_automator.

viearical avatar viearical commented on May 11, 2024

Does anybody know how or what Subler (https://bitbucket.org/galad87/subler) uses to pull meta data from the iTunes store? That app seems to bee pretty reliably querying all the meta data and full size art work for shows and movies.

from sickbeard_mp4_automator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.