Skip to content

Commit

Permalink
Merge pull request WikiTeam#425 from simonliu99/append_date
Browse files Browse the repository at this point in the history
Display appended-date IA URL if appended
  • Loading branch information
nemobis authored Mar 22, 2022
2 parents 1f911c0 + 3638e69 commit 054397a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,11 @@ def upload(wikis, config={}, uploadeddumps=[]):
c = 0
for dump in dumps:
wikidate = dump.split('-')[1]
item = get_item('wiki-' + wikiname)
identifier = 'wiki-' + wikiname
item = get_item(identifier)
if item.exists and config.append_date and not config.admin:
item = get_item('wiki-' + wikiname + '-' + wikidate)
identifier += '-' + wikidate
item = get_item(identifier)
if dump in uploadeddumps:
if config.prune_directories:
rmline='rm -rf %s-%s-wikidump/' % (wikiname, wikidate)
Expand Down Expand Up @@ -246,7 +248,7 @@ def upload(wikis, config={}, uploadeddumps=[]):
try:
item.upload(dumpdir + '/' + dump, metadata=md, access_key=accesskey, secret_key=secretkey, verbose=True, queue_derive=False)
item.modify_metadata(md) # update
print 'You can find it in https://archive.org/details/wiki-%s' % (wikiname)
print 'You can find it in https://archive.org/details/%s' % (identifier)
uploadeddumps.append(dump)
except Exception as e:
print wiki, dump, 'Error when uploading?'
Expand Down

0 comments on commit 054397a

Please sign in to comment.