Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Updated subscene after change in how download is handled, again. #160

Merged
merged 1 commit into from

2 participants

@IcEBnd

Also improved some exception debug messages.

@amet amet merged commit 02e7c54 into amet:eden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 13, 2013
  1. Updated subscene after change in how download is handled, again. Impr…

    IcEBnd authored
    …oved some exception debug messages.
This page is out of date. Refresh to see the latest.
View
15 script.xbmc.subtitles/resources/lib/services/Subscene/service.py
@@ -52,12 +52,11 @@
# group(1) = link, group(2) = movie_season_title, group(3) = year
-# <form action="/subtitle/download" id="dl" method="post" name="dl"><button type="submit" onclick="DownloadSubtitle(this)" id="downloadButton" class="Positive">
-#downloadlink_pattern = "\(new WebForm_PostBackOptions\([^\n\r\t]+?\/([^\n\r\t]+?)&quot;, false, true\)\)"
-downloadlink_pattern = '<form action="([^"]*)" id="dl" method="post" name="dl">'
+# <a href="/subtitle/download?mac=YdYi9-p24hR49B2zIIEoUrXDYN2b4yBreI8TJIBfpdxDuDw-sRIvu8_GvuFAUO3w0" rel="nofollow" onclick="DownloadSubtitle(this)" id="downloadButton" class="button Positive">Download English Subtitle
+downloadlink_pattern = '<a href="(/subtitle/download\?mac=[^"]*)"'
-# <input type="hidden" name="mac" id="mac" value="iYpZfE2uRLwuOANcMW196bXDYN2b4yBreI8TJIBfpdxYfHbaSkp83VDK3BdyW77J0" />
-mac_pattern = '<input type="hidden" name="mac" id="mac" value="([^"]*)" />'
+# <a href="/subtitle/download?mac=YdYi9-p24hR49B2zIIEoUrXDYN2b4yBreI8TJIBfpdxDuDw-sRIvu8_GvuFAUO3w0" rel="nofollow"
+mac_pattern = 'mac=([^"]*)"'
# Content-Disposition: attachment; filename=dexter-seventh-season-2012_english-661907.zip
filetype_pattern = 'attachment; filename=.*\.(.*)$'
@@ -242,8 +241,8 @@ class MyOpener(urllib.FancyURLopener):
local_file_handle = open(local_tmp_file, "w" + "b")
local_file_handle.write(response.read())
local_file_handle.close()
- except:
- log( __name__ ,"%s Failed to save subtitles to '%s'" % (debug_pretext, local_tmp_file))
+ except Exception as ex:
+ log( __name__ ,"%s Failed to save subtitles to '%s' exception: '%s'" % (debug_pretext, local_tmp_file, str(ex)))
if packed:
files = os.listdir(tmp_sub_dir)
init_filecount = len(files)
@@ -283,5 +282,5 @@ class MyOpener(urllib.FancyURLopener):
return False, language, subs_file #standard output
except Exception as ex:
- log( __name__ ,"%s %s" % (debug_pretext, ex.message))
+ log( __name__ ,"%s %s" % (debug_pretext, str(ex)))
Something went wrong with that request. Please try again.