Skip to content

Commit

Permalink
modified: configure.ac
Browse files Browse the repository at this point in the history
	modified:   subsdownloader2/CONTROL/control
	modified:   subsdownloader2/src/SourceCode/NapiProjekt.py
	modified:   subsdownloader2/src/SourceCode/Napisy24_pl.py
	modified:   subsdownloader2/src/SourceCode/anysub2srt.py
	modified:   subsdownloader2/src/SourceCode/archives_extractor.py
	modified:   subsdownloader2/src/SourceCode/xbmc_subtitles/XBMC_search.py
	new file:   subsdownloader2/src/SourceCode/xbmc_subtitles/services/Itasa/Makefile.am
	new file:   subsdownloader2/src/SourceCode/xbmc_subtitles/services/Itasa/__init__.py
	new file:   subsdownloader2/src/SourceCode/xbmc_subtitles/services/Itasa/service.py
	modified:   subsdownloader2/src/SourceCode/xbmc_subtitles/services/Makefile.am
	modified:   subsdownloader2/src/SourceCode/xbmc_subtitles/services/Napisyme/service.py
	modified:   subsdownloader2/src/about.nfo
	new file:   subsdownloader2/src/pic/Itasa.jpg
	modified:   subsdownloader2/src/plugin.py
  • Loading branch information
root committed Jan 19, 2012
1 parent 3e59432 commit 6b6b32a
Show file tree
Hide file tree
Showing 15 changed files with 335 additions and 51 deletions.
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -519,6 +519,7 @@ subsdownloader2/src/SourceCode/periscope/services/OpenSubtitle/Makefile
subsdownloader2/src/SourceCode/xbmc_subtitles/Makefile
subsdownloader2/src/SourceCode/xbmc_subtitles/services/Makefile
subsdownloader2/src/SourceCode/xbmc_subtitles/services/Napisyme/Makefile
subsdownloader2/src/SourceCode/xbmc_subtitles/service/Itasa/Makefile
svdrp/Makefile
svdrp/meta/Makefile
Expand Down
2 changes: 1 addition & 1 deletion subsdownloader2/CONTROL/control
@@ -1,5 +1,5 @@
Package: enigma2-plugin-extensions-subsdownloader
Version: 0.27.0-20120108
Version: 0.28.6-20120119
Description: Subtitle Downloader
Section: extra
Priority: optional
Expand Down
3 changes: 3 additions & 0 deletions subsdownloader2/src/SourceCode/NapiProjekt.py
Expand Up @@ -22,6 +22,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

prog = "NapiProjekt"
i = 0
i_total = 0
try:
from hashlib import md5 as md5
except ImportError:
Expand Down
6 changes: 4 additions & 2 deletions subsdownloader2/src/SourceCode/Napisy24_pl.py
Expand Up @@ -343,10 +343,12 @@ def compare_movie_and_subtitle_FileData(self, movie_file_data, subtitle_file_dat
#Cause and effect for subtitle and movie guesseFileData results
if x[1].has_key('type') and y[1].has_key('type'):
if x[1]['type'] == y[1]['type']:
wynik = wynik + 0.1600
#wynik = wynik + 0.1600
wynik = wynik +0.0900
if x[1].has_key('name') and y[1].has_key('name'):
if x[1]['name'] == y[1]['name']:
wynik = wynik +0.0900
#wynik = wynik +0.0900
wynik = wynik + 0.1600
if x[1].has_key('season') and y[1].has_key('season'):
if x[1]['season'] == y[1]['season']:
wynik = wynik +0.0225
Expand Down
17 changes: 0 additions & 17 deletions subsdownloader2/src/SourceCode/anysub2srt.py
Expand Up @@ -144,23 +144,6 @@ def read_srt(self,list):
sys.stderr.write("Warning: it seems like input file is damaged or too short.\n")
return subtitles

# try:
# while len(list)>0:
# if re1.match(list.pop(0), 0):
# m = re2.match(list.pop(0), 0)
# if m:
# subt = [int(m.group(1))*3600 + int(m.group(2))*60 + int(m.group(3)) + int(m.group(4))/1000.0]
# subt.append(int(m.group(5))*3600 + int(m.group(6))*60 + int(m.group(7)) + int(m.group(8))/1000.0)
# l = list.pop(0)
# while not re3.match(l, 0):
# subt.append(l.strip())
# l = list.pop(0)
# subtitles.append(subt)
# #except IndexError:
# except:
# sys.stderr.write("Warning: it seems like input file is damaged or too short.\n")
# return subtitles

def read_tmp(self,list):
"""
Reads tmplayer (tmp) subtitles.
Expand Down
54 changes: 52 additions & 2 deletions subsdownloader2/src/SourceCode/archives_extractor.py
@@ -1,5 +1,7 @@
import zipfile

#from Plugins.Extensions.SubsDownloader2.SourceCode import rarfile

# Copyright (C) 2011 Dawid Bankowski <enigma2subsdownloader@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -61,9 +63,57 @@ def extract_zipped_file(self):
else:
print "%s is not a zip file." % zip__path
return False
"""
class rar_extractor():
def __init__(self, rar__path, destination_dir = None, extracted_extension_filter = None):
self.__rar__path = rar__path
self.__destination_dir = destination_dir
self.__extracted_extension_filter = extracted_extension_filter
def open_rar_file_to_read(self,rar__path):
try:
rar_data = rarfile.RarFile(rar__path)
rar_file_list = rar_data.namelist()
return rar_data, rar_file_list
rar_data.close()
except:
print "There is problem with %s reading" % rar__path
return False


def rared_file_list(self, rar_file_temp_list, extraction_filter = None):
rar_file_list =[]
for x in rar_file_temp_list:
if extraction_filter != None:
if x.rsplit(".",1)[1] in extraction_filter:
rar_file_list.append(x)
else:
rar_file_list.append(x)
return rar_file_list
def extract_rared_file(self):
if self.__destination_dir == None:
destination_dir = (self.__rar__path.rsplit("/",1))[0]
else:
destination_dir = self.__destination_dir
if rarfile.is_rarfile(self.__rar__path):
rar_data, rar_file_list = self.open_rar_file_to_read(self.__rar__path)
extraction_file_list = self.rared_file_list(rar_file_list, self.__extracted_extension_filter)
#try:
extracted_files_path =[]
for x in extraction_file_list:
rar_data.extract(x, destination_dir)
print "Files %s from rar %s extracted to dir: %s.\n" % (x,self.__rar__path,destination_dir)
extracted_files_path.append(destination_dir+"/"+x)
return extracted_files_path
#except:
# print "Rar %s was not extracted to dir: %s" % (self.__rar__path,destination_dir)
# return False
else:
print "%s is not a rar file." % rar__path
return False"""

#USE
#zip__path = "C:/1111/Lord of the ring.zip"
#aa = zip_extractor(zip__path,None,("txt","sub","srt"))
Expand Down
30 changes: 21 additions & 9 deletions subsdownloader2/src/SourceCode/xbmc_subtitles/XBMC_search.py
Expand Up @@ -12,33 +12,40 @@ def list_XBMC_Periscope_plugins(XBMC_periscope_plugin_path):
plugin_list.append(x)
return plugin_list

"""

def list_directory_files(dir_path):
file_list = []
for x in os.listdir(dir_path):
if os.path.isdir(XMBC_plugin_path+x) == False:
if os.path.isdir(dir_path+x) == False:
file_list.append(dir_path+x)
return file_list"""
"""
return file_list

def new_file_in_directory(files_before, files_after):
new_file = []
for x in files_after:
if x in files_before:
pass
else:
new_file.append(x)
return new_file"""
#XBMCSubtitle not USED
return new_file


"""
#XBMCSubtitle code for PC not USED in Enigma2
#from XBMC.services.Itasa import service as SERVICE
from periscope.plugins.SubtitleDatabase import SubtitleDB
from periscope.plugins.SubtitleDatabase import *
class XBMCSubtitle(SubtitleDB):
def __init__(self,service):
self.tvshowRegex = tvshowRegex
self.tvshowRegex2 = tvshowRegex2
self.movieRegex = movieRegex
exec ('from Plugins.Extensions.SubsDownloader2.SourceCode.xbmc_subtitles.services.%s import *' % service)
exec ('from Plugins.Extensions.SubsDownloader2.SourceCode.xbmc_subtitles.services.%s import service as Service' % service)
exec ('from XBMC.services.%s import *' % service)
exec ('from XBMC.services.%s import service as Service' % service)
self.service = Service
Expand Down Expand Up @@ -84,4 +91,9 @@ def XBMC_download_subtitles(self, pos):
session_id = self.__session_id
subtitles_list = self.__subtitles_list
return self.service.download_subtitles (subtitles_list, pos, zipped_subs_path, tmp_sub_dir, sub_folder, session_id) #ZWRAA False, language, subs_file #standard output
file_path = "C:/!Roboczy/How.I.Met.Your.Mother.S07E12.HDTV.XviD-LOL.[VTV].avi"
SERVICE = XBMCSubtitle("Itasa")
a, b, c = SERVICE.XBMC_search_subtitles(file_path, "all", "All","All")
"""
@@ -0,0 +1,4 @@
installdir = $(libdir)/enigma2/python/Plugins/Extensions/SubsDownloader2/SourceCode/xbmc_subtitles/services/Itasa/


install_PYTHON = *.py
Empty file.

0 comments on commit 6b6b32a

Please sign in to comment.