Skip to content

Commit

Permalink
[service.subtitles.zimuku] 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
taxigps committed May 2, 2017
1 parent b43bc11 commit 36c86cf
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addons.xml
Expand Up @@ -820,7 +820,7 @@ For Non-PRC OS environment (Windows7|WindowsXP):[CR]"Control Panel"|"Region and

<addon id="service.subtitles.zimuku"
name="zimuku"
version="1.0.3"
version="1.0.4"
provider-name="taxigps">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
2 changes: 1 addition & 1 deletion addons.xml.md5
@@ -1 +1 @@
f7f88029deb5145b28fa165723e0b979
37026c9bc3fd0e948f391677209e0471
14 changes: 14 additions & 0 deletions repo/service.subtitles.zimuku/changelog-1.0.4.txt
@@ -0,0 +1,14 @@
1.0.4
- add User-Agent in http request to get subtitles

1.0.3
- fixed can't get subtitles because site changed

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
Binary file not shown.
2 changes: 1 addition & 1 deletion service.subtitles.zimuku/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.zimuku"
name="zimuku"
version="1.0.3"
version="1.0.4"
provider-name="taxigps">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
Expand Down
5 changes: 4 additions & 1 deletion service.subtitles.zimuku/changelog.txt
@@ -1,4 +1,7 @@
1.0.3
1.0.4
- add User-Agent in http request to get subtitles

1.0.3
- fixed can't get subtitles because site changed

1.0.2
Expand Down
19 changes: 15 additions & 4 deletions service.subtitles.zimuku/service.py
Expand Up @@ -5,6 +5,7 @@
import sys
import xbmc
import urllib
import urllib2
import xbmcvfs
import xbmcaddon
import xbmcgui,xbmcplugin
Expand All @@ -26,6 +27,7 @@

ZIMUKU_API = 'http://www.zimuku.net/search?q=%s'
ZIMUKU_BASE = 'http://www.zimuku.net'
UserAgent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'

def log(module, msg):
xbmc.log((u"%s::%s - %s" % (__scriptname__,module,msg,)).encode('utf-8'),level=xbmc.LOGDEBUG )
Expand All @@ -44,7 +46,9 @@ def Search( item ):
else:
url = ZIMUKU_API % (item['title'])
try:
socket = urllib.urlopen(url)
req = urllib2.Request(url)
req.add_header('User-Agent', UserAgent)
socket = urllib2.urlopen(req)
data = socket.read()
socket.close()
soup = BeautifulSoup(data)
Expand All @@ -55,7 +59,9 @@ def Search( item ):
moviename = it.find("div", class_="title").a.text.encode('utf-8')
movieurl = '%s%s' % (ZIMUKU_BASE, it.find("div", class_="title").a.get('href').encode('utf-8'))
try:
socket = urllib.urlopen(movieurl)
req = urllib2.Request(movieurl)
req.add_header('User-Agent', UserAgent)
socket = urllib2.urlopen(req)
data = socket.read()
socket.close()
soup = BeautifulSoup(data).find("div", class_="subs box clearfix")
Expand Down Expand Up @@ -113,11 +119,16 @@ def Download(url,lang):
subtitle_list = []
exts = [".srt", ".sub", ".smi", ".ssa", ".ass" ]
try:
socket = urllib.urlopen( url )
req = urllib2.Request(url)
req.add_header('User-Agent', UserAgent)
socket = urllib2.urlopen(req)
data = socket.read()
socket.close()
soup = BeautifulSoup(data)
url = '%s%s' % (ZIMUKU_BASE, soup.find("li", class_="dlsub").a.get('href').encode('utf-8'))
socket = urllib.urlopen( url )
req = urllib2.Request(url)
req.add_header('User-Agent', UserAgent)
socket = urllib2.urlopen(req)
filename = socket.headers['Content-Disposition'].split('filename=')[1]
if filename[0] == '"' or filename[0] == "'":
filename = filename[1:-1]
Expand Down

0 comments on commit 36c86cf

Please sign in to comment.