jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Change getFilename() for support all file format in flickr

from flickr API get file format

Change-Id: I0faf9be7310b6e12a113c1fcfe29917aa5b7496f
---
M scripts/flickrripper.py
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/scripts/flickrripper.py b/scripts/flickrripper.py
index 610fab0..5873ed5 100755
--- a/scripts/flickrripper.py
+++ b/scripts/flickrripper.py
@@ -191,18 +191,19 @@
else:
# Use the id of the photo as last resort.
title = photoInfo.find('photo').attrib['id']
-
- if pywikibot.Page(site, 'File:{} - {} - {}.jpg'
- .format(title, project, username)).exists():
+ fileformat = photoInfo.find('photo').attrib['originalformat']
+ if pywikibot.Page(site, 'File:{} - {} - {}.{}'
+ .format(title, project, username, fileformat)).exists():
i = 1
while True:
- name = '{} - {} - {} ({}).jpg'.format(title, project, username, i)
+ name = '{} - {} - {} ({}).{}'.format(title, project, username,
+ i, fileformat)
if pywikibot.Page(site, 'File:' + name).exists():
i += 1
else:
return name
else:
- return '{} - {} - {}.jpg'.format(title, project, username)
+ return '{} - {} - {}.{}'.format(title, project, username, fileformat)


def cleanUpTitle(title):

To view, visit change 576071. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0faf9be7310b6e12a113c1fcfe29917aa5b7496f
Gerrit-Change-Number: 576071
Gerrit-PatchSet: 11
Gerrit-Owner: Shizhao <shizhao@gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Zoranzoki21 <zorandori4444@gmail.com>