Skip to content

Commit

Permalink
new string replace in packed
Browse files Browse the repository at this point in the history
  • Loading branch information
kokangit committed Jan 25, 2018
1 parent b00798e commit b6239c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<addon id="plugin.video.dreamfilm" name="Dreamfilm" provider-name="Daniel Lundin" version="0.1.15.11">
<addon id="plugin.video.dreamfilm" name="Dreamfilm" provider-name="Daniel Lundin" version="0.1.15.12">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
</requires>
Expand Down
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ Fixed issue #53: added resolver for jawcloud
version 0.1.15.11
=================
improved resolver for jawcloud

version 0.1.15.12
=================
new string replace in packed
13 changes: 13 additions & 0 deletions vendor/packer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ def _replacestrings(source):
for index, value in enumerate(lookup):
source = source.replace(variable % index, '"%s"' % value)
return source[startpoint:]

replaces = re.findall(r'\'(.+?)\'\.replace\(/(.+)/[gi]*,(.+?)\)', source,
re.DOTALL)
if replaces:
for repl in replaces:
origstr = repl[0]
searchstr = repl[1].replace('\\', '')
try:
replstr = eval(repl[2].replace('\\', ''))
except Exception, e:
replstr = repl[2].replace('\\', '')
newstr = origstr.replace(searchstr, replstr)
source = source.replace(origstr, newstr)
return source


Expand Down

0 comments on commit b6239c3

Please sign in to comment.