chiark
/
gitweb
/
~matthewv
/
irc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ed94078
)
Patch from adam to allow - in video URLs
author
Matthew Vernon
<matthewv@chiark.greenend.org.uk>
Wed, 14 Sep 2016 10:37:16 +0000
(11:37 +0100)
committer
Matthew Vernon
<matthewv@chiark.greenend.org.uk>
Wed, 14 Sep 2016 10:37:16 +0000
(11:37 +0100)
commands.py
patch
|
blob
|
history
diff --git
a/commands.py
b/commands.py
index cea3a2a6d2d3ef627735184bcfdfab3cce978a9f..491ab3c7254840f476270abd60f8c6f33e478004 100755
(executable)
--- a/
commands.py
+++ b/
commands.py
@@
-529,7
+529,7
@@
def getTweet(urlstring,twitapi,inclusion=False):
for k,v in replacements.items():
for k,v in replacements.items():
- v = [re.sub(r"/tweet_video_thumb/(
\w
+).jpg", r"/tweet_video/\1.mp4", link) for link in v]
+ v = [re.sub(r"/tweet_video_thumb/(
[\w\-]
+).jpg", r"/tweet_video/\1.mp4", link) for link in v]
if len(v) > 1:
replacementstring = "[" + " ; ".join(v) +"]"
else:
if len(v) > 1:
replacementstring = "[" + " ; ".join(v) +"]"
else:
@@
-593,4
+593,5
@@
def getTweet(urlstring,twitapi,inclusion=False):
stringout = "Error: %s" % terror[1].__str__()
if inclusion:
return stringout # don't want to double-encode it, so just pass it on for now and encode later
stringout = "Error: %s" % terror[1].__str__()
if inclusion:
return stringout # don't want to double-encode it, so just pass it on for now and encode later
+ print stringout.encode('UTF-8', 'replace')
return stringout.encode('UTF-8', 'replace')
return stringout.encode('UTF-8', 'replace')