From: Matthew Vernon Date: Wed, 14 Sep 2016 10:37:16 +0000 (+0100) Subject: Patch from adam to allow - in video URLs X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?p=irc.git;a=commitdiff_plain;h=981cb7de621c978ed35c78b3260e322c9d5ac3b9 Patch from adam to allow - in video URLs --- diff --git a/commands.py b/commands.py index cea3a2a..491ab3c 100755 --- a/commands.py +++ b/commands.py @@ -529,7 +529,7 @@ def getTweet(urlstring,twitapi,inclusion=False): 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: @@ -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 + print stringout.encode('UTF-8', 'replace') return stringout.encode('UTF-8', 'replace')