#44 √ resolved
RDV

Slight error in the gets series for mult-languages

Reported by RDV | April 18th, 2009 @ 12:37 AM

dbr/Ben: When you changed tvdb_api to add language you skipped the change:

    series = urllib.quote(series.encode("utf-8"))

Adding the encode is essential to make the urllib.quote work.

Please add this change as well.

Thanks

Comments and changes to this ticket

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 06:39 AM

    • → State changed from “new” to “accepted”

    Opps..

    Do you have an example showname/expected-episode-name, so I could write a test for it?

  • RDV

    RDV April 18th, 2009 @ 06:56 AM

    Try this file name it is in Japanese (ja). It does have a season 1 and episode 1 with all the graphics. I use it as part of my test suit of multi-language file names. Ignore the "(21st copy)" as that is not the real episode name, it does note adversely effect testing.

    DARKER THAN BLACK -黒の契約者- - S01E01 (21st copy).mkv

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 06:57 AM

    (from [d1ce0fadfc3e9e8f74b23f07683045f111d9f9fa]) Encode series name using utf-8, before urlencoding [#44] http://github.com/dbr/tvdb_api/c...

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 07:12 AM

    Strange, I can't seem to get it working.. The API getSeries.php seems to act differently to the main site's search:

    http://www.thetvdb.com/api/GetSe...

    ..returns nothing, but with the same urlencoded search string..

    http://thetvdb.com/index.php?sea...

    ..works fine.

    Did you get it working? Could you try running the following:

    from tvdb_api import Tvdb
    t = Tvdb(debug=True)
    t[u'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i']
    
    

    I get the following output:

    >>> t[u'T\xecnh Ng\u01b0\u1eddi Hi\u1ec7n \u0110\u1ea1i']
    2009-04-17 22:32:03,640) DEBUG Getting show tình người hiện đại
    2009-04-17 22:32:03,641) DEBUG Searching for show t%C3%ACnh%20ng%C6%B0%E1%BB%9Di%20hi%E1%BB%87n%20%C4%91%E1%BA%A1i
    2009-04-17 22:32:03,642) DEBUG Retrieving ElementTree source for URL http://www.thetvdb.com/api/GetSe...
    
    

    I don't think the language matters, it's only a preferred language (language=cn makes no difference either, assuming that show is Chinese..?)

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 07:29 AM

    Err, in fact, the API seems to be having problems just now. All show-related tests are failing, even with version 0.6 (which I know is fine)..

  • RDV

    RDV April 18th, 2009 @ 07:38 AM

    dbr/Ben: You had a mistake on this line, it works with: t = Tvdb(debug=True, language=u'zh') See: http://pastebin.ca/1395321

    Ignore the last unicode error as it is an issue with stdout wanting str's

  • RDV

    RDV April 18th, 2009 @ 07:44 AM

    If you need a solution to the print, stdout and stderr issue with unicode as I suspect it will impact tvnamer, then see this:

    http://pastebin.ca/1395330

    It works great for me solved numerous unicode exceptions.

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 08:16 AM

    Ah, it was all working (there was a problem with thetvdb.com, waiting/wiping-the-cached sorted it)

    Just noticed on the API docs:

    This is the abbreviation for the language you want to search in. If omitted, it will default to en (English). This may also be set to all, which will search ALL translations for .

    Perhaps this might be a more sensible default than 'en'..? Adding support for it to tvdb_api now..

  • RDV

    RDV April 18th, 2009 @ 08:22 AM

    Having a default of 'all' would not effect my scripts. If you add it you should return the language type when the tv series is selected. You may already do this, I never checked. That will be important when you go to get episode data or select graphics based on language.

    I would not want to loose the default to English when getting episode data if the request language has no episode data. That one I do need or at least I would have to add new logic.

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 08:54 AM

    • → State changed from “accepted” to “resolved”

    (from [5edc8edfd22fa09d7082e8dc7f85b3b70891bd3e]) Added search_all_languages option to Tvdb, which searches in all languages [#44 state:resolved] http://github.com/dbr/tvdb_api/c...

  • dbr/Ben

    dbr/Ben April 18th, 2009 @ 08:58 AM

    • → State changed from “resolved” to “accepted”

    I've added a search_all_languages option to Tvdb.. Seems to work correctly...?

    It turned out you can't specify language='all', as ../series/12345/all.xml doesn't exist (The 'all' language is only valid for getSeries)

    with search_all_languages, it'll find the series in whatever language it can, but return the data in the correct language (default being english)

    http://github.com/dbr/tvdb_api/b...

    Let me know how that works.. Tomorrow or so I'll try and sort the unicode handling in tvnamer..

  • RDV

    RDV April 18th, 2009 @ 10:09 PM

    I can confirm that the latest release of tvdb_api works with multi-language filenames.

    Thanks

  • dbr/Ben

    dbr/Ben April 21st, 2009 @ 04:35 AM

    • → Tag changed from “” to “bug tvdb_api”
    • → State changed from “accepted” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags

You can update this ticket by sending an email to from your email client. (help)