From af3b399b7517466d27bb1487fc7a45f3f92d7bcf Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Tue, 11 Dec 2018 16:34:31 +0000 Subject: [PATCH] strip more garbage out of twitter urls (esp the ?s=[:digits:]) tracking code - thanks cjwatson --- commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands.py b/commands.py index 3974bfb..698bfdb 100755 --- a/commands.py +++ b/commands.py @@ -526,9 +526,9 @@ def getTweet(urlstring,twitapi,inclusion=False,recurlvl=0): unobfuscate_urls=True expand_included_tweets=True stringsout=[] - - parts = string.split(urlstring,'/') - tweetID = parts[-1] + + path = urlparse.urlparse(urlstring).path + tweetID = path.split('/')[-1] try: status = twitapi.GetStatus(tweetID) if status == {}: -- 2.30.2