From d284c61faa1d92829a9e268f9920a99c13be061e Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 10 Feb 2014 19:35:35 +0100 Subject: [PATCH] =?utf8?q?[picasa]=20Pour=20r=C3=A9cup=C3=A9rer=20les=20ph?= =?utf8?q?otos=20avec=20bonne=20r=C3=A9solution=20et=20pas=20un=20sous-pro?= =?utf8?q?duit=20de=20thumbnail?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- download_picasa_album.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/download_picasa_album.py b/download_picasa_album.py index b86cf06..6b294f7 100755 --- a/download_picasa_album.py +++ b/download_picasa_album.py @@ -26,14 +26,12 @@ def album_to_links(album): medias = album.xpath("//media:group", namespaces=album.nsmap) processed = [] for media in medias: - contenturls = media.xpath("./media:content", namespaces=media.nsmap) - # Pour les photos il n'y a qu'un seul media:content - # Mais pour la vidéo, il y a un thumbnail avant - if len(contenturls) > 1: - contenturl = contenturls[1] - else: - contenturl = contenturls[0] + contenturls = media.xpath("./media:thumbnail", namespaces=media.nsmap) + print [i.items() for i in contenturls] + contenturl = contenturls[-1] contenturl = [val for (kw, val) in contenturl.items() if kw == "url"][0] + # On récupère la meilleure résolution de l'image + contenturl = contenturl.replace("s288", "s5000") title = media.xpath("./media:title", namespaces=media.nsmap)[0] title = title.text processed.append([title, contenturl]) -- 2.39.2