Skip to content

Commit

Permalink
update opensubtitle api url (not working..)
Browse files Browse the repository at this point in the history
  • Loading branch information
nofxx committed Oct 4, 2010
1 parent f14b512 commit 6da1c0b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions bin/subtitle_it
Expand Up @@ -4,6 +4,7 @@
# Created on 2008-09-04.
# Copyleft (c) 2008. MIT License.
#
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
begin
require 'rubygems'
rescue LoadError
Expand Down
3 changes: 3 additions & 0 deletions lib/subtitle_it/languages.rb
Expand Up @@ -4,6 +4,8 @@ module SubtitleIt
# Cze => Czech ....
#
# LANGUAGE / HUMAN NAME / OPENSUBTITLE CODE
#
# Need to rewrite "Portuguese" => [:pt, :por, :whatever]
LANGS = {
:aa => 'Afar',
:ab => 'Abkhazian',
Expand Down Expand Up @@ -58,4 +60,5 @@ module SubtitleIt
:ro => 'Romanian',
:zh => 'Chinese'
}

end
13 changes: 7 additions & 6 deletions lib/subtitle_it/subdown.rb
Expand Up @@ -9,7 +9,7 @@

module SubtitleIt
class Subdown
HOST = "http://www.opensubtitles.org/xml-rpc"
HOST = "http://api.opensubtitles.org/xml-rpc"
HOST_DEV = "http://dev.opensubtitles.org/xml-rpc"

USER_AGENT = "SubtitleIt #{SubtitleIt::VERSION::STRING}"
Expand Down Expand Up @@ -70,12 +70,13 @@ def imdb_info(movie)
movie.info = result['data'][movie.haxx] # TODO: Handle if no result for movie
end

# def subtitle_languages
# LANGS.map { |l| l[0].to_s }
# TODO.. get the correct codes
# end
def self.subtitle_languages
LANGS.map do |k, v|
"#{k} -> #{v}"
end.join("\n")
end
#
# def Subdown.opsub_id( language ) # Get the Opensubtitle.org language id from the language string (e.g. 'French' returns 'fra' )
# def Subdown.opsub_id( language ) # Get the Opensubtitle.org language id from the language string (e.g. 'French' returns 'fra' )
# ary = LANGS.find do |sym_lang|
# sym_lang if sym_lang[1].downcase == language.downcase
# end
Expand Down

0 comments on commit 6da1c0b

Please sign in to comment.