Skip to content

Commit

Permalink
mxq dump
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiwei.meng committed Nov 16, 2017
1 parent d661c07 commit f2a5989
Show file tree
Hide file tree
Showing 183 changed files with 3,894 additions and 13 deletions.
Binary file added KODI/kodi-repo-v2.0.0.zip
Binary file not shown.
15 changes: 15 additions & 0 deletions KODI/kodi-repo-v2.0.0/repository.kodi-repo/addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="repository.kodi-repo" name="Joname's repo" version="2.0.0" provider-name="Joname">
<extension point="xbmc.addon.repository" name="Joname's repo">
<info compressed="true">https://github.com/joname1/kodi-repo/raw/master/addons.xml</info>
<checksum>https://github.com/joname1/kodi-repo/raw/master/addons.xml.md5</checksum>
<datadir zip="true">https://github.com/joname1/kodi-repo/raw/master/repo</datadir>
</extension>
<extension point="xbmc.addon.metadata">
<summary>Joname's Repository</summary>
<summary lang="zh">分享中文插件的插件库</summary>
<description>Download and install add-ons from Joname's repository.[CR][CR]By using this Repository you will be able to take advantage of our cutting edge features developed for chinese people.</description>
<description lang="zh">从Joname插件库下载安装插件。[CR][CR]通过使用这个程序库,你将能够分享我们为中文用户开发的插件。</description>
<platform>all</platform>
</extension>
</addon>
6 changes: 6 additions & 0 deletions KODI/kodi-repo-v2.0.0/repository.kodi-repo/changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[B]Version 1.0.0[/B]
- My initial repo on github.com.

[B]Version 2.0.0[/B]
- Fixed bugs.
- Replace icon.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added KODI/repository.xbmc-addons-chinese-1.2.0.zip
Binary file not shown.
Binary file added KODI/service.subtitles.163sub-1.0.3.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.163sub"
name="163sub"
version="1.0.3"
provider-name="taxigps">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simplejson" version="3.3.0"/>
<import addon="script.module.beautifulsoup4" version="4.3.2"/>
</requires>
<extension point="xbmc.subtitle.module"
library="service.py" />
<extension point="xbmc.addon.metadata">
<summary lang="en">163sub subtitle</summary>
<summary lang="zh">163字幕网</summary>
<description lang="en">Search and download subtitles from www.163sub.com</description>
<description lang="zh">从 www.163sub.com 下载字幕</description>
</extension>
</addon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1.0.3
- fixed subtitle file download failed

1.0.2
- fixed can't remove temp dir under android

1.0.1
- support search subtitles for tv shows in library

1.0.0
- initial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
msgid ""
msgstr ""

#Chinese Simplified

msgctxt "#32001"
msgid "Number of results"
msgstr "显示搜索字幕数量"

msgctxt "#32002"
msgid "First ten"
msgstr "前10个"

msgctxt "#32003"
msgid "All"
msgstr "所有"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
msgid ""
msgstr ""

#Chinese Traditional

msgctxt "#32001"
msgid "Number of results"
msgstr "顯示搜索字幕數量"

msgctxt "#32002"
msgid "First ten"
msgstr "前10個"

msgctxt "#32003"
msgid "All"
msgstr "所有"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
msgid ""
msgstr ""

#English

msgctxt "#32001"
msgid "Number of results"
msgstr ""

msgctxt "#32002"
msgid "First ten"
msgstr ""

msgctxt "#32003"
msgid "All"
msgstr ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="resultsNumber" type="enum" label="32001" lvalues="32002|32003" default="0"/>
</settings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# -*- coding: utf-8 -*-

import re
import os
import sys
import xbmc
import urllib
import xbmcvfs
import xbmcaddon
import xbmcgui,xbmcplugin
import simplejson
from bs4 import BeautifulSoup

__addon__ = xbmcaddon.Addon()
__author__ = __addon__.getAddonInfo('author')
__scriptid__ = __addon__.getAddonInfo('id')
__scriptname__ = __addon__.getAddonInfo('name')
__version__ = __addon__.getAddonInfo('version')
__language__ = __addon__.getLocalizedString

__cwd__ = xbmc.translatePath( __addon__.getAddonInfo('path') ).decode("utf-8")
__profile__ = xbmc.translatePath( __addon__.getAddonInfo('profile') ).decode("utf-8")
__resource__ = xbmc.translatePath( os.path.join( __cwd__, 'resources', 'lib' ) ).decode("utf-8")
__temp__ = xbmc.translatePath( os.path.join( __profile__, 'temp') ).decode("utf-8")

sys.path.append (__resource__)

SEARCH_API = 'http://www.163sub.com/search.ashx?q=%s&lastid=%s'
DOWNLOAD_API = 'http://www.163sub.com/download/%s'

def log(module, msg):
xbmc.log((u"%s::%s - %s" % (__scriptname__,module,msg,)).encode('utf-8'),level=xbmc.LOGDEBUG )

def normalizeString(str):
return str

def Search( item ):
subtitles_list = []

if item['mansearch']:
search_str = item['mansearchstr']
elif len(item['tvshow']) > 0:
search_str = "%s S%.2dE%.2d" % (item['tvshow'],
int(item['season']),
int(item['episode']),)
else:
search_str = item['title']
log( __name__ ,"Search for [%s] with [%s]" % (os.path.basename( item['file_original_path'] ),search_str.decode('utf-8')))
search_str = urllib.quote(search_str)
lastid = ''
results = []
try:
while True:
url = SEARCH_API % (search_str, lastid)
socket = urllib.urlopen(url)
data = socket.read()
json_response = simplejson.loads(data)
lastid = json_response['Data'][-1]['linkID']
results.extend(json_response['Data'])
if __addon__.getSetting("resultsNumber") == "0" or len(json_response['Data']) < 10:
break
socket.close()
except:
return
for sub in results:
version = sub['fileName'].encode('utf-8').replace('&amp;','&')
version = version[:-4]
if version[-4:] in ('.rar', '.zip'):
version = version[:-4]
langs = sub['language'].encode('utf-8')
id = sub['ID'].encode('utf-8')
ext = sub['sext'].encode('utf-8')
name = '[%s]%s (%s)' % (ext, version, langs)
if ('简' in langs) or ('繁' in langs) or ('中' in langs) or ('双' in langs):
subtitles_list.append({"language_name":"Chinese", "filename":name, "link":id, "language_flag":'zh', "rating":"0", "lang":langs})
else:
subtitles_list.append({"language_name":"English", "filename":name, "link":id, "language_flag":'en', "rating":"0", "lang":langs})

if subtitles_list:
for it in subtitles_list:
listitem = xbmcgui.ListItem(label=it["language_name"],
label2=it["filename"],
iconImage=it["rating"],
thumbnailImage=it["language_flag"]
)

listitem.setProperty( "sync", "false" )
listitem.setProperty( "hearing_imp", "false" )

url = "plugin://%s/?action=download&link=%s&lang=%s" % (__scriptid__,
it["link"],
it["lang"]
)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)

def rmtree(path):
if isinstance(path, unicode):
path = path.encode('utf-8')
dirs, files = xbmcvfs.listdir(path)
for dir in dirs:
rmtree(os.path.join(path, dir))
for file in files:
xbmcvfs.delete(os.path.join(path, file))
xbmcvfs.rmdir(path)

def Download(id,lang):
try: rmtree(__temp__)
except: pass
try: os.makedirs(__temp__)
except: pass

subtitle_list = []
exts = [".srt", ".sub", ".smi", ".ssa", ".ass" ]
url = DOWNLOAD_API % (id)
try:
socket = urllib.urlopen( url )
data = socket.read()
soup = BeautifulSoup(data)
url = soup.find("a", class_="down_ink download_link").get('href').encode('utf-8')
socket = urllib.urlopen( url )
#filename = socket.headers['Content-Disposition'].split('filename=')[1]
#if filename[0] == '"' or filename[0] == "'":
# filename = filename[1:-1]
filename = os.path.basename(url)
data = socket.read()
socket.close()
except:
return []
if len(data) < 1024:
return []
tempfile = os.path.join(__temp__, "subtitles%s" % os.path.splitext(filename)[1])
with open(tempfile, "wb") as subFile:
subFile.write(data)
subFile.close()
xbmc.sleep(500)
if data[:4] == 'Rar!' or data[:2] == 'PK':
xbmc.executebuiltin(('XBMC.Extract("%s","%s")' % (tempfile,__temp__,)).encode('utf-8'), True)
path = __temp__
dirs, files = xbmcvfs.listdir(path)
if len(dirs) > 0:
path = os.path.join(__temp__, dirs[0].decode('utf-8'))
dirs, files = xbmcvfs.listdir(path)
list = []
for subfile in files:
if (os.path.splitext( subfile )[1] in exts):
list.append(subfile.decode('utf-8'))
if len(list) == 1:
subtitle_list.append(os.path.join(path, list[0]))
else:
sel = xbmcgui.Dialog().select('请选择压缩包中的字幕', list)
if sel == -1:
sel = 0
subtitle_list.append(os.path.join(path, list[sel]))

return subtitle_list

def get_params():
param=[]
paramstring=sys.argv[2]
if len(paramstring)>=2:
params=paramstring
cleanedparams=params.replace('?','')
if (params[len(params)-1]=='/'):
params=params[0:len(params)-2]
pairsofparams=cleanedparams.split('&')
param={}
for i in range(len(pairsofparams)):
splitparams={}
splitparams=pairsofparams[i].split('=')
if (len(splitparams))==2:
param[splitparams[0]]=splitparams[1]

return param

params = get_params()
if params['action'] == 'search' or params['action'] == 'manualsearch':
item = {}
item['temp'] = False
item['rar'] = False
item['mansearch'] = False
item['year'] = xbmc.getInfoLabel("VideoPlayer.Year") # Year
item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season")) # Season
item['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode")) # Episode
item['tvshow'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle")) # Show
item['title'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle")) # try to get original title
item['file_original_path'] = urllib.unquote(xbmc.Player().getPlayingFile().decode('utf-8')) # Full path of a playing file
item['3let_language'] = []

if 'searchstring' in params:
item['mansearch'] = True
item['mansearchstr'] = params['searchstring']

for lang in urllib.unquote(params['languages']).decode('utf-8').split(","):
item['3let_language'].append(xbmc.convertLanguage(lang,xbmc.ISO_639_2))

if item['title'] == "":
item['title'] = xbmc.getInfoLabel("VideoPlayer.Title") # no original title, get just Title
if item['title'] == os.path.basename(xbmc.Player().getPlayingFile()): # get movie title and year if is filename
title, year = xbmc.getCleanMovieTitle(item['title'])
item['title'] = normalizeString(title.replace('[','').replace(']',''))
item['year'] = year

if item['episode'].lower().find("s") > -1: # Check if season is "Special"
item['season'] = "0" #
item['episode'] = item['episode'][-1:]

if ( item['file_original_path'].find("http") > -1 ):
item['temp'] = True

elif ( item['file_original_path'].find("rar://") > -1 ):
item['rar'] = True
item['file_original_path'] = os.path.dirname(item['file_original_path'][6:])

elif ( item['file_original_path'].find("stack://") > -1 ):
stackPath = item['file_original_path'].split(" , ")
item['file_original_path'] = stackPath[0][8:]

Search(item)

elif params['action'] == 'download':
subs = Download(params["link"], params["lang"])
for sub in subs:
listitem = xbmcgui.ListItem(label=sub)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=sub,listitem=listitem,isFolder=False)

xbmcplugin.endOfDirectory(int(sys.argv[1]))
Binary file added KODI/service.subtitles.makedie-1.0.8.zip
Binary file not shown.
Binary file added KODI/service.subtitles.subhd-1.0.6.zip
Binary file not shown.
Binary file added KODI/service.subtitles.subom-1.0.2.zip
Binary file not shown.
Binary file added KODI/service.subtitles.zimuku-1.0.2.zip
Binary file not shown.
Binary file added apks/XX-Net-3.0-debug.apk
Binary file not shown.
55 changes: 55 additions & 0 deletions aria2/aria2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# location
dir=/storage/udisk0/part2/aria2Download/
disk-cache=156M
file-allocation=prealloc
continue=true

max-concurrent-downloads=50
max-connection-per-server=5
min-split-size=10M
split=5
#max-overall-download-limit=0
#max-download-limit=0
#max-overall-upload-limit=0
#max-upload-limit=0
disable-ipv6=true

input-file=/storage/udisk0/part2/aria2Session/aria2.session
save-session=/storage/udisk0/part2/aria2Session/aria2.session
save-session-interval=60
force-save=true

enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true

#event-poll=select
rpc-listen-port=6900
rpc-secret=mmxAria2EncryptPassWd


follow-torrent=true
listen-port=51413
bt-max-peers=96
enable-dht=false
enable-dht6=false
#dht-listen-port=6881-6999
bt-enable-lpd=false
enable-peer-exchange=false
#bt-request-peer-speed-limit=50K
#peer-id-prefix=-TR2770-
#user-agent=Transmission/2.77
user-agent=uTorrent/341(109279400)(30888)
peer-id-prefix=-UT341-

seed-ratio=0
bt-hash-check-seed=true
bt-seed-unverified=true
bt-save-metadata=true


#seed-time=120
ftp-pasv=true

#if log If empty string("") is specified, or this option is omitted, no log is written to disk at all.
#log=/storage/udisk0/part2/aria2Session/aria2.log
Loading

0 comments on commit f2a5989

Please sign in to comment.