pywaybackup 1.3.0__tar.gz → 1.3.2__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.
Files changed (29) hide show
  1. {pywaybackup-1.3.0/pywaybackup.egg-info → pywaybackup-1.3.2}/PKG-INFO +29 -18
  2. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/README.md +28 -17
  3. pywaybackup-1.3.2/pywaybackup/__version__.py +1 -0
  4. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/archive.py +8 -5
  5. {pywaybackup-1.3.0 → pywaybackup-1.3.2/pywaybackup.egg-info}/PKG-INFO +29 -18
  6. pywaybackup-1.3.0/pywaybackup/__version__.py +0 -1
  7. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/.github/ISSUE_TEMPLATE/bug.md +0 -0
  8. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/.gitignore +0 -0
  9. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/LICENSE +0 -0
  10. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/dev/pip_build.sh +0 -0
  11. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/dev/venv_create.sh +0 -0
  12. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/Exception.py +0 -0
  13. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/SnapshotCollection.py +0 -0
  14. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/Verbosity.py +0 -0
  15. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/__init__.py +0 -0
  16. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/arguments.py +0 -0
  17. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/helper.py +0 -0
  18. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup/main.py +0 -0
  19. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup.egg-info/SOURCES.txt +0 -0
  20. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup.egg-info/dependency_links.txt +0 -0
  21. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup.egg-info/entry_points.txt +0 -0
  22. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup.egg-info/requires.txt +0 -0
  23. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/pywaybackup.egg-info/top_level.txt +0 -0
  24. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/requirements.txt +0 -0
  25. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/setup.cfg +0 -0
  26. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/setup.py +0 -0
  27. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/test/cdx.example.com.200 +0 -0
  28. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/test/cdx.example.com.404 +0 -0
  29. {pywaybackup-1.3.0 → pywaybackup-1.3.2}/test/cdx.example.com.small.200 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pywaybackup
3
- Version: 1.3.0
3
+ Version: 1.3.2
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
@@ -27,10 +27,6 @@ Internet-archive is a nice source for several OSINT-information. This tool is a
27
27
 
28
28
  This tool allows you to download content from the Wayback Machine (archive.org). You can use it to download either the latest version or all versions of web page snapshots within a specified range.
29
29
 
30
- ## Info
31
-
32
- Linux recommended: On windows machines, the path length is limited. It can only be overcome by editing the registry. Files which exceed the path length will not be downloaded.
33
-
34
30
  ## Installation
35
31
 
36
32
  ### Pip
@@ -48,6 +44,11 @@ Linux recommended: On windows machines, the path length is limited. It can only
48
44
  ```pip install .```
49
45
  - in a virtual env or use `--break-system-package`
50
46
 
47
+ ## Usage infos
48
+
49
+ - Linux recommended: On Windows machines, the path length is limited. This can only be overcome by editing the registry. Files that exceed the path length will not be downloaded.
50
+ - If you query an explicit file (e.g. a query-string `?query=this` or `login.html`), the `--explicit`-argument is recommended as a wildcard query may lead to an empty result.
51
+
51
52
  ## Arguments
52
53
 
53
54
  - `-h`, `--help`: Show the help message and exit.
@@ -55,25 +56,35 @@ Linux recommended: On windows machines, the path length is limited. It can only
55
56
 
56
57
  ### Required
57
58
 
58
- - `-u`, `--url`: The URL of the web page to download. This argument is required.
59
+ - **`-u`**, **`--url`**:<br>
60
+ The URL of the web page to download. This argument is required.
59
61
 
60
62
  #### Mode Selection (Choose One)
61
- - `-c`, `--current`: Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
62
- - `-f`, `--full`: Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
63
- - `-s`, `--save`: Save a page to the Wayback Machine. (beta)
63
+ - **`-c`**, **`--current`**:<br>
64
+ Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
65
+ - **`-f`**, **`--full`**:<br>
66
+ Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
67
+ - **`-s`**, **`--save`**:<br>
68
+ Save a page to the Wayback Machine. (beta)
64
69
 
65
70
  ### Optional query parameters
66
71
 
67
- - `-l`, `--list`: Only print the snapshots available within the specified range. Does not download the snapshots.
68
- - `-e`, `--explicit`: Only download the explicit given url. No wildcard subdomains or paths. Use e.g. to get root-only snapshots.
69
- - `-o`, `--output`: Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
72
+ - **`-l`**, **`--list`**:<br>
73
+ Only print the snapshots available within the specified range. Does not download the snapshots.
74
+ - **`-e`**, **`--explicit`**:<br>
75
+ Only download the explicit given URL. No wildcard subdomains or paths. Use e.g. to get root-only snapshots. This is recommended for explicit files like `login.html` or `?query=this`.
76
+ - **`-o`**, **`--output`**:<br>
77
+ Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
70
78
 
71
79
  - **Range Selection:**<br>
72
- Specify the range in years or a specific timestamp either start, end or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
73
- (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
74
- - `-r`, `--range`: Specify the range in years for which to search and download snapshots.
75
- - `--start`: Timestamp to start searching.
76
- - `--end`: Timestamp to end searching.
80
+ Specify the range in years or a specific timestamp either start, end, or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
81
+ (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
82
+ - **`-r`**, **`--range`**:<br>
83
+ Specify the range in years for which to search and download snapshots.
84
+ - **`--start`**:<br>
85
+ Timestamp to start searching.
86
+ - **`--end`**:<br>
87
+ Timestamp to end searching.
77
88
 
78
89
  ### Additional behavior manipulation
79
90
 
@@ -81,7 +92,7 @@ Specify the range in years or a specific timestamp either start, end or both. If
81
92
  Path defaults to output-dir. Saves a CSV file with the json-response for successfull downloads. If `--list` is set, the CSV contains the CDX list of snapshots. If `--current` or `--full` is set, CSV contains downloaded files. Named as `waybackup_<sanitized_url>.csv`.
82
93
 
83
94
  - **`--skip`** `<path>`:<br>
84
- Path defaults to output-dir. Checks for an existing `waybackup_<domain>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
95
+ Path defaults to output-dir. Checks for an existing `waybackup_<sanitized_url>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
85
96
 
86
97
  - **`--no-redirect`**:<br>
87
98
  Disables following redirects of snapshots. Useful for preventing timestamp-folder mismatches caused by Archive.org redirects.
@@ -11,10 +11,6 @@ Internet-archive is a nice source for several OSINT-information. This tool is a
11
11
 
12
12
  This tool allows you to download content from the Wayback Machine (archive.org). You can use it to download either the latest version or all versions of web page snapshots within a specified range.
13
13
 
14
- ## Info
15
-
16
- Linux recommended: On windows machines, the path length is limited. It can only be overcome by editing the registry. Files which exceed the path length will not be downloaded.
17
-
18
14
  ## Installation
19
15
 
20
16
  ### Pip
@@ -32,6 +28,11 @@ Linux recommended: On windows machines, the path length is limited. It can only
32
28
  ```pip install .```
33
29
  - in a virtual env or use `--break-system-package`
34
30
 
31
+ ## Usage infos
32
+
33
+ - Linux recommended: On Windows machines, the path length is limited. This can only be overcome by editing the registry. Files that exceed the path length will not be downloaded.
34
+ - If you query an explicit file (e.g. a query-string `?query=this` or `login.html`), the `--explicit`-argument is recommended as a wildcard query may lead to an empty result.
35
+
35
36
  ## Arguments
36
37
 
37
38
  - `-h`, `--help`: Show the help message and exit.
@@ -39,25 +40,35 @@ Linux recommended: On windows machines, the path length is limited. It can only
39
40
 
40
41
  ### Required
41
42
 
42
- - `-u`, `--url`: The URL of the web page to download. This argument is required.
43
+ - **`-u`**, **`--url`**:<br>
44
+ The URL of the web page to download. This argument is required.
43
45
 
44
46
  #### Mode Selection (Choose One)
45
- - `-c`, `--current`: Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
46
- - `-f`, `--full`: Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
47
- - `-s`, `--save`: Save a page to the Wayback Machine. (beta)
47
+ - **`-c`**, **`--current`**:<br>
48
+ Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
49
+ - **`-f`**, **`--full`**:<br>
50
+ Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
51
+ - **`-s`**, **`--save`**:<br>
52
+ Save a page to the Wayback Machine. (beta)
48
53
 
49
54
  ### Optional query parameters
50
55
 
51
- - `-l`, `--list`: Only print the snapshots available within the specified range. Does not download the snapshots.
52
- - `-e`, `--explicit`: Only download the explicit given url. No wildcard subdomains or paths. Use e.g. to get root-only snapshots.
53
- - `-o`, `--output`: Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
56
+ - **`-l`**, **`--list`**:<br>
57
+ Only print the snapshots available within the specified range. Does not download the snapshots.
58
+ - **`-e`**, **`--explicit`**:<br>
59
+ Only download the explicit given URL. No wildcard subdomains or paths. Use e.g. to get root-only snapshots. This is recommended for explicit files like `login.html` or `?query=this`.
60
+ - **`-o`**, **`--output`**:<br>
61
+ Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
54
62
 
55
63
  - **Range Selection:**<br>
56
- Specify the range in years or a specific timestamp either start, end or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
57
- (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
58
- - `-r`, `--range`: Specify the range in years for which to search and download snapshots.
59
- - `--start`: Timestamp to start searching.
60
- - `--end`: Timestamp to end searching.
64
+ Specify the range in years or a specific timestamp either start, end, or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
65
+ (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
66
+ - **`-r`**, **`--range`**:<br>
67
+ Specify the range in years for which to search and download snapshots.
68
+ - **`--start`**:<br>
69
+ Timestamp to start searching.
70
+ - **`--end`**:<br>
71
+ Timestamp to end searching.
61
72
 
62
73
  ### Additional behavior manipulation
63
74
 
@@ -65,7 +76,7 @@ Specify the range in years or a specific timestamp either start, end or both. If
65
76
  Path defaults to output-dir. Saves a CSV file with the json-response for successfull downloads. If `--list` is set, the CSV contains the CDX list of snapshots. If `--current` or `--full` is set, CSV contains downloaded files. Named as `waybackup_<sanitized_url>.csv`.
66
77
 
67
78
  - **`--skip`** `<path>`:<br>
68
- Path defaults to output-dir. Checks for an existing `waybackup_<domain>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
79
+ Path defaults to output-dir. Checks for an existing `waybackup_<sanitized_url>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
69
80
 
70
81
  - **`--no-redirect`**:<br>
71
82
  Disables following redirects of snapshots. Useful for preventing timestamp-folder mismatches caused by Archive.org redirects.
@@ -0,0 +1 @@
1
+ __version__ = "1.3.2"
@@ -97,7 +97,7 @@ def print_list():
97
97
  # create filelist
98
98
  # timestamp format yyyyMMddhhmmss
99
99
  def query_list(url: str, range: int, start: int, end: int, explicit: bool, mode: str, cdxbackup: str, cdxinject: str):
100
-
100
+
101
101
  def inject(cdxinject):
102
102
  if os.path.isfile(cdxinject):
103
103
  vb.write("\nInjecting CDX data...")
@@ -121,13 +121,15 @@ def query_list(url: str, range: int, start: int, end: int, explicit: bool, mode:
121
121
 
122
122
  domain, subdir, filename = url_split(url)
123
123
  if domain and not subdir and not filename:
124
- cdx_url = f"*.{domain}/*" if not explicit else f"{domain}"
124
+ cdx_url = f"{domain}"
125
125
  if domain and subdir and not filename:
126
- cdx_url = f"{domain}/{subdir}/*"
126
+ cdx_url = f"{domain}/{subdir}"
127
127
  if domain and subdir and filename:
128
- cdx_url = f"{domain}/{subdir}/{filename}/*"
128
+ cdx_url = f"{domain}/{subdir}/{filename}"
129
129
  if domain and not subdir and filename:
130
- cdx_url = f"{domain}/{filename}/*"
130
+ cdx_url = f"{domain}/{filename}"
131
+ if not explicit:
132
+ cdx_url = f"{cdx_url}/*"
131
133
 
132
134
  vb.write(f"---> {cdx_url}")
133
135
  cdxQuery = f"https://web.archive.org/cdx/search/cdx?output=json&url={cdx_url}{query_range}&fl=timestamp,digest,mimetype,statuscode,original&filter!=statuscode:200"
@@ -146,6 +148,7 @@ def query_list(url: str, range: int, start: int, end: int, explicit: bool, mode:
146
148
 
147
149
  return cdxResult
148
150
 
151
+ cdxResult = None
149
152
  if cdxinject:
150
153
  cdxResult = inject(cdxinject)
151
154
  if not cdxResult:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pywaybackup
3
- Version: 1.3.0
3
+ Version: 1.3.2
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
@@ -27,10 +27,6 @@ Internet-archive is a nice source for several OSINT-information. This tool is a
27
27
 
28
28
  This tool allows you to download content from the Wayback Machine (archive.org). You can use it to download either the latest version or all versions of web page snapshots within a specified range.
29
29
 
30
- ## Info
31
-
32
- Linux recommended: On windows machines, the path length is limited. It can only be overcome by editing the registry. Files which exceed the path length will not be downloaded.
33
-
34
30
  ## Installation
35
31
 
36
32
  ### Pip
@@ -48,6 +44,11 @@ Linux recommended: On windows machines, the path length is limited. It can only
48
44
  ```pip install .```
49
45
  - in a virtual env or use `--break-system-package`
50
46
 
47
+ ## Usage infos
48
+
49
+ - Linux recommended: On Windows machines, the path length is limited. This can only be overcome by editing the registry. Files that exceed the path length will not be downloaded.
50
+ - If you query an explicit file (e.g. a query-string `?query=this` or `login.html`), the `--explicit`-argument is recommended as a wildcard query may lead to an empty result.
51
+
51
52
  ## Arguments
52
53
 
53
54
  - `-h`, `--help`: Show the help message and exit.
@@ -55,25 +56,35 @@ Linux recommended: On windows machines, the path length is limited. It can only
55
56
 
56
57
  ### Required
57
58
 
58
- - `-u`, `--url`: The URL of the web page to download. This argument is required.
59
+ - **`-u`**, **`--url`**:<br>
60
+ The URL of the web page to download. This argument is required.
59
61
 
60
62
  #### Mode Selection (Choose One)
61
- - `-c`, `--current`: Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
62
- - `-f`, `--full`: Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
63
- - `-s`, `--save`: Save a page to the Wayback Machine. (beta)
63
+ - **`-c`**, **`--current`**:<br>
64
+ Download the latest version of each file snapshot. You will get a rebuild of the current website with all available files (but not any original state because new and old versions are mixed).
65
+ - **`-f`**, **`--full`**:<br>
66
+ Download snapshots of all timestamps. You will get a folder per timestamp with the files available at that time.
67
+ - **`-s`**, **`--save`**:<br>
68
+ Save a page to the Wayback Machine. (beta)
64
69
 
65
70
  ### Optional query parameters
66
71
 
67
- - `-l`, `--list`: Only print the snapshots available within the specified range. Does not download the snapshots.
68
- - `-e`, `--explicit`: Only download the explicit given url. No wildcard subdomains or paths. Use e.g. to get root-only snapshots.
69
- - `-o`, `--output`: Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
72
+ - **`-l`**, **`--list`**:<br>
73
+ Only print the snapshots available within the specified range. Does not download the snapshots.
74
+ - **`-e`**, **`--explicit`**:<br>
75
+ Only download the explicit given URL. No wildcard subdomains or paths. Use e.g. to get root-only snapshots. This is recommended for explicit files like `login.html` or `?query=this`.
76
+ - **`-o`**, **`--output`**:<br>
77
+ Defaults to `waybackup_snapshots` in the current directory. The folder where downloaded files will be saved.
70
78
 
71
79
  - **Range Selection:**<br>
72
- Specify the range in years or a specific timestamp either start, end or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
73
- (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
74
- - `-r`, `--range`: Specify the range in years for which to search and download snapshots.
75
- - `--start`: Timestamp to start searching.
76
- - `--end`: Timestamp to end searching.
80
+ Specify the range in years or a specific timestamp either start, end, or both. If you specify the `range` argument, the `start` and `end` arguments will be ignored. Format for timestamps: YYYYMMDDhhmmss. You can only give a year or increase specificity by going through the timestamp starting on the left.<br>
81
+ (year 2019, year+month 201901, year+month+day 20190101, year+month+day+hour 2019010112)
82
+ - **`-r`**, **`--range`**:<br>
83
+ Specify the range in years for which to search and download snapshots.
84
+ - **`--start`**:<br>
85
+ Timestamp to start searching.
86
+ - **`--end`**:<br>
87
+ Timestamp to end searching.
77
88
 
78
89
  ### Additional behavior manipulation
79
90
 
@@ -81,7 +92,7 @@ Specify the range in years or a specific timestamp either start, end or both. If
81
92
  Path defaults to output-dir. Saves a CSV file with the json-response for successfull downloads. If `--list` is set, the CSV contains the CDX list of snapshots. If `--current` or `--full` is set, CSV contains downloaded files. Named as `waybackup_<sanitized_url>.csv`.
82
93
 
83
94
  - **`--skip`** `<path>`:<br>
84
- Path defaults to output-dir. Checks for an existing `waybackup_<domain>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
95
+ Path defaults to output-dir. Checks for an existing `waybackup_<sanitized_url>.csv` for URLs to skip downloading. Useful for interrupted downloads. Files are checked by their root-domain, ensuring consistency across queries. This means that if you download `http://example.com/subdir1/` and later `http://example.com`, the second query will skip the first path.
85
96
 
86
97
  - **`--no-redirect`**:<br>
87
98
  Disables following redirects of snapshots. Useful for preventing timestamp-folder mismatches caused by Archive.org redirects.
@@ -1 +0,0 @@
1
- __version__ = "1.3.0"
File without changes
File without changes
File without changes
File without changes