Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update opensubtitle api url (not working..)

  • Loading branch information...
commit 6da1c0b758993ce21a59a954b4136cf63274e5ae 1 parent f14b512
Marcos Piccinini authored
1  bin/subtitle_it
View
@@ -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
3  lib/subtitle_it/languages.rb
View
@@ -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',
@@ -58,4 +60,5 @@ module SubtitleIt
:ro => 'Romanian',
:zh => 'Chinese'
}
+
end
13 lib/subtitle_it/subdown.rb
View
@@ -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}"
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.