[releng/abderrahim/urlencoded-links] convert-to-tarballs: handle urlencoded links




commit 27d29f7813cd44660e86926aca834fdb4f9e4165
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Wed Dec 23 16:40:17 2020 +0100

    convert-to-tarballs: handle urlencoded links

 tools/smoketesting/downloadsites.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tools/smoketesting/downloadsites.py b/tools/smoketesting/downloadsites.py
index c50138b..593a9b9 100644
--- a/tools/smoketesting/downloadsites.py
+++ b/tools/smoketesting/downloadsites.py
@@ -28,6 +28,7 @@ import os
 
 from html.parser import HTMLParser
 from posixpath import join as posixjoin # Handy for URLs
+from urllib.parse import unquote
 
 # Classes that define the different types of sites we can download from
 class DownloadSite:
@@ -154,7 +155,7 @@ def get_links(html):
 
         def handle_starttag(self, tag, attrs):
             if tag == 'a':
-                href = [v for k, v in attrs if k=='href']
+                href = [unquote(v) for k, v in attrs if k=='href']
                 if href:
                     self.urls.extend(href)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]