Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated Subtitles.gr service.

  • Loading branch information...
commit 111ff4ba1ad9f2ca0a913a428cf8178f353c2e1d 1 parent 98a753e
lambda81 authored
View
19 script.xbmc.subtitles/resources/lib/services/SubtitlesGr/service.py
@@ -68,27 +68,24 @@ def search_subtitles( file_original_path, title, tvshow, year, season, episode,
getallsubs(searchstring, "el", "Greek", subtitles_list)
if greek == 0:
- msg = "Won't work, Greeksubtitlesproject is only for Greek subtitles."
+ msg = "Won't work, subtitles.gr is only for Greek subtitles."
return subtitles_list, "", msg #standard output
-
def download_subtitles (subtitles_list, pos, zip_subs, tmp_sub_dir, sub_folder, session_id): #standard input
id = subtitles_list[pos][ "id" ]
language = subtitles_list[pos][ "language_name" ]
- if string.lower(language) == "greek":
- url = download_url + id
+ if string.lower(language) == "greek": url = download_url + id
local_file = open(zip_subs, "w" + "b")
f = urllib.urlopen(url)
local_file.write(f.read())
local_file.close()
- tmp_new_dir = tmp_sub_dir+'\sub_dir'
+ tmp_new_dir = os.path.join( tmp_sub_dir ,"zipsubs" )
+ tmp_new_dir_2 = os.path.join( tmp_new_dir ,"subs" )
xbmc.executebuiltin("XBMC.Extract(" + zip_subs + "," + tmp_new_dir +")")
- time.sleep(2)
+ xbmc.sleep(1000)
+ for file in os.listdir(tmp_new_dir_2): file=os.path.join(tmp_new_dir_2, file)
+ shutil.copy(file, tmp_sub_dir)
os.remove(zip_subs)
- for file in os.listdir(tmp_new_dir+'\subs'):
- file=os.path.join(tmp_new_dir+'\subs', file)
- xbmc.executebuiltin("XBMC.Extract(" + file + "," + tmp_sub_dir +")")
- time.sleep(2)
- shutil.rmtree(tmp_new_dir)
+ shutil.rmtree(tmp_new_dir)
return True,language, "" #standard output
Please sign in to comment.
Something went wrong with that request. Please try again.