pywaybackup 1.2.0__tar.gz → 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pywaybackup
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Download snapshots from the Wayback Machine
5
5
  Home-page: https://github.com/bitdruid/python-wayback-machine-downloader
6
6
  Author: bitdruid
@@ -0,0 +1 @@
1
+ __version__ = "1.2.1"
@@ -225,6 +225,7 @@ def download_loop(snapshot_queue, output, worker, retry, no_redirect, skipset=No
225
225
  download_loop(failed_urls, output, worker, retry, no_redirect, skipset, attempt, connection, failed_urls)
226
226
  except Exception as e:
227
227
  ex.exception(f"Worker: {worker} - Exception", e)
228
+ snapshot_queue.put(snapshot) # requeue snapshot if worker crashes
228
229
 
229
230
 
230
231
 
@@ -293,7 +294,6 @@ def download(output, snapshot_entry, connection, status_message, no_redirect=Fal
293
294
  f"FILENAME TOO LONG -> HTTP: {response_status} - {response_status_message}\n" + \
294
295
  f" -> URL: {download_url}"
295
296
  vb.write(status_message)
296
- #skip_write(skipset, snapshot_entry["url_archive"]) if skipset is not None else None
297
297
  return True
298
298
 
299
299
  if not os.path.isfile(output_file):
@@ -314,7 +314,6 @@ def download(output, snapshot_entry, connection, status_message, no_redirect=Fal
314
314
  f" -> FILE: {output_file}"
315
315
  vb.write(status_message)
316
316
  sc.snapshot_entry_modify(snapshot_entry, "file", output_file)
317
- #skip_write(skipset, snapshot_entry["url_archive"], output_file) if skipset is not None else None
318
317
  return True
319
318
 
320
319
  else:
@@ -384,20 +383,21 @@ def csv_close(csv_path: str, url: str):
384
383
  with open(csv_path, mode='a') as file: # append new rows
385
384
  row = csv.DictWriter(file, sc.SNAPSHOT_COLLECTION[0].keys())
386
385
  for snapshot in sc.SNAPSHOT_COLLECTION:
387
- if snapshot["url_archive"] not in existing_rows:
386
+ if snapshot["response"] is not False and snapshot["url_archive"] not in existing_rows: # only append handled snapshots
388
387
  row.writerow(snapshot)
389
388
  else: # create new file
390
389
  with open(csv_path, mode='w') as file:
391
390
  row = csv.DictWriter(file, sc.SNAPSHOT_COLLECTION[0].keys())
392
391
  row.writeheader()
393
392
  for snapshot in sc.SNAPSHOT_COLLECTION:
394
- row.writerow(snapshot)
393
+ if snapshot["response"] is not False: # only append handled snapshots
394
+ row.writerow(snapshot)
395
395
  except Exception as e:
396
396
  ex.exception("Could not save CSV-file", e)
397
397
 
398
398
  def csv_read(csv_file: object) -> list:
399
399
  """
400
- Read the CSV file and return a list of existing snapshot urls.
400
+ Read the CSV file and return a list of existing snapshot urls with a status (any status means file was handled)
401
401
  """
402
402
  try:
403
403
  csv_reader = csv.reader(csv_file)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pywaybackup
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: Download snapshots from the Wayback Machine
5
5
  Home-page: https://github.com/bitdruid/python-wayback-machine-downloader
6
6
  Author: bitdruid
@@ -1 +0,0 @@
1
- __version__ = "1.2.0"
File without changes
File without changes
File without changes
File without changes