arxiv-dl 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/arxiv/downloader/html_archive.rb +15 -7
- data/lib/arxiv/downloader/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 34f7046b2c2b52988b860c9257481f9434ca427feb018346dd66fe87c73ec13d
|
|
4
|
+
data.tar.gz: 21afcc2a72d40d1a8c98690066d39a05c182aa6739d0cf6cb21cfc54a79ece67
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff13eecbd1489e0c865044f69703fa50ccec59a953fe23a227d9c2b4daa2aa2769bb79e538cb1e8bfdbed2dfe4cb8097ec758e761b958de5bf02ffbd9f0483ef
|
|
7
|
+
data.tar.gz: 55a30abd80c2252150fbe8736fff4a52fbbe4a143737610cbb578e686f771fb2f30bd7238ea69a0bd3fb105426cf136600d3089c545188909d6510517133ae7e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.1.1]
|
|
2
|
+
|
|
3
|
+
Bug fix: the HTML archive step crashed with `NoMethodError` on papers whose HTML embeds `data:` URI images (e.g. arxiv's feedback-overlay mascot), and mis-fetched root-relative `/static/...` asset references from a wrong page-relative URL.
|
|
4
|
+
|
|
5
|
+
- Asset references are now routed by type: page-relative refs download as siblings, absolute `http(s)` refs cache under `_shared/`, root-relative refs are absolutized against `arxiv.org` and cache under `_shared/`, and unfetchable refs (`data:`, `javascript:`, `mailto:`, malformed URIs) are left in the HTML untouched.
|
|
6
|
+
|
|
1
7
|
## [0.1.0]
|
|
2
8
|
|
|
3
9
|
First release. Per-paper offline archive of arxiv.org papers, with PDF, abstract HTML, full HTML version (with relative-path images and a deduplicated cross-paper shared assets cache), TeX source, and four metadata sidecar files.
|
|
@@ -38,17 +38,25 @@ module Arxiv
|
|
|
38
38
|
reference = node[attribute]
|
|
39
39
|
return if reference.nil? || reference.empty?
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
case reference_type(reference)
|
|
42
|
+
when :page_relative then download_relative reference, html_dir
|
|
43
|
+
when :remote then cache_remote node, attribute, reference, html_dir
|
|
44
|
+
when :root_relative then cache_remote node, attribute, "https://arxiv.org#{reference}", html_dir
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
# :skip covers refs that can't or shouldn't be fetched: data:/javascript:/
|
|
49
|
+
# mailto: URIs, protocol-relative refs, and malformed URIs. They are left
|
|
50
|
+
# in the HTML untouched.
|
|
51
|
+
def reference_type reference
|
|
52
|
+
uri = URI.parse reference
|
|
53
|
+
return :remote if %w[http https].include? uri.scheme
|
|
54
|
+
return :skip unless uri.scheme.nil? && uri.host.nil?
|
|
55
|
+
return :root_relative if reference.start_with? '/'
|
|
56
|
+
|
|
57
|
+
:page_relative
|
|
50
58
|
rescue URI::InvalidURIError
|
|
51
|
-
|
|
59
|
+
:skip
|
|
52
60
|
end
|
|
53
61
|
|
|
54
62
|
def download_relative reference, html_dir
|