From 981cb7de621c978ed35c78b3260e322c9d5ac3b9 Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Wed, 14 Sep 2016 11:37:16 +0100 Subject: [PATCH] Patch from adam to allow - in video URLs --- commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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') -- 2.30.2