dbr / tvdb_api

Simple to use interface to TheTVDB.com API in Python
The Unlicense
339 stars 63 forks source link

useZip as config param. this will load the zip url from tvdb #20

Closed lad1337 closed 12 years ago

lad1337 commented 12 years ago

useZip (bool): Download the zip archive where possibale, instead of the xml. This is only used when all episodes are pulled. And only the main language xml is used, the actor and banner xml are lost.

i only did some small tests and runtest.py went fine ... i did not add any test :/ but i reran all test with the useZip option

log of both test runs http://pastebin.com/raw.php?i=Xtrn1nMm

dbr commented 12 years ago

Looks good, although can you clarrify what you mean by "only the main language xml is used, the actor and banner xml are lost"? Does this mean Tvdb(useZip = True, actors=True) should raise an exception, because the two are incompatible, or.. something else?

lad1337 commented 12 years ago

no no ... just the zip contains the "{language}.xml" (<- main langage xml) and the "actor.xml" and "banner.xml" but the zip is only downloaded on the {tvdb_id}/all/{language}.xml request (which is now {tvdb_id}/all/{language}.zip) only the "{language}.xml" is unpacked from the zip and returned therefor "the actor.xml" and "banner.xml" are not preserved for later use

dbr commented 12 years ago

Ahh, got it - so the zip contains the actors/banners, but they are unused, for now.

Thanks - I'll merge this shortly!

thezoggy commented 12 years ago

if you view: http://thetvdb.com/api/<apikey>/series/71256/all/en.zip you will see the files (en == language)

dbr commented 12 years ago

Merged, 53c360a16628981a60c1509e24fd769e62c1f28b , with TODO about using {banners,actors}.xml - thanks!

dbr commented 12 years ago

Oh, the ZipFile.open method doesn't exist in Python 2.5, http://travis-ci.org/#!/dbr/tvdb_api/jobs/1134438 - changed it to use ZipFile.read

lad1337 commented 12 years ago

oh sry ... good to know ... thanks