Commit 2dd1f8c 1 parent a8c7fa6 commit 2dd1f8c Copy full SHA for 2dd1f8c
File tree 1 file changed +5
-7
lines changed
1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -58,19 +58,17 @@ def expand_shortened_url(url: str) -> str:
58
58
logger .info ("Try expanding shortened URL: %s" , url )
59
59
# Strip trailing punctuation if present
60
60
stripped_url = url .rstrip (".," )
61
- punctuation = url [
62
- len (stripped_url ) :
63
- ] # Store the punctuation for re-attachment if needed
64
61
try :
65
62
response = requests .get (
66
63
stripped_url , allow_redirects = True , timeout = config_manager .TIMEOUT
67
64
)
68
- expanded_url = response .url
69
- logger .info ("Expanded URL %s to full link: %s" , stripped_url , expanded_url )
70
- return expanded_url + punctuation
71
65
except requests .RequestException :
72
66
logger .exception ("Error expanding shortened URL: %s" , url )
73
- return url
67
+ return url
68
+ else :
69
+ expanded_url = response .url
70
+ logger .info ("Expanded URL %s to full link: %s" , stripped_url , expanded_url )
71
+ return expanded_url
74
72
75
73
76
74
def extract_embedded_url (query_params : dict [str , list [str ]]) -> set [str ]:
You can’t perform that action at this time.
0 commit comments