panchira 1.3.6 → 1.4.0
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/.github/workflows/ruby.yml +16 -13
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +3 -3
- data/lib/panchira/resolvers/nijie_resolver.rb +10 -10
- data/lib/panchira/resolvers/pixiv_resolver.rb +1 -1
- data/lib/panchira/version.rb +1 -1
- data/panchira.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87af8a25ccd6d841b133aaa28ce7853c0111ae0ce4768f287a1f9a8a09eec148
|
4
|
+
data.tar.gz: 93233eca9a9fd019fb82aafbd1e97630aa242d1645d2e2306fee52d1812aa144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42e8539356b8c73b8cced17cdaec2452960f17175736a004702c37e7370f407ea995504a07e2b060c53f52629f42cb247e34080d9e54c52a07158fddb5e427c1
|
7
|
+
data.tar.gz: 4b1746f991ba2353304c96e3297efca0a45ba0e3d9c908f653e72aa6920de3654f2714235d24037de591699287bf0c027b0720d6e2741cf3ef6a6e5ae1add95a
|
data/.github/workflows/ruby.yml
CHANGED
@@ -9,22 +9,25 @@ name: Ruby
|
|
9
9
|
|
10
10
|
on:
|
11
11
|
push:
|
12
|
-
branches: [
|
12
|
+
branches: [master]
|
13
13
|
pull_request:
|
14
|
-
branches: [
|
14
|
+
branches: [master]
|
15
15
|
|
16
16
|
jobs:
|
17
17
|
test:
|
18
|
-
|
19
18
|
runs-on: ubuntu-18.04
|
20
|
-
|
19
|
+
strategy:
|
20
|
+
fail-fast: false
|
21
|
+
matrix:
|
22
|
+
ruby: ["2.7", "3.0"]
|
23
|
+
name: Ruby ${{ matrix.ruby }}
|
21
24
|
steps:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
- uses: actions/checkout@v2
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
- name: Install dependencies
|
31
|
+
run: bundle install
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rake test
|
data/.rubocop.yml
CHANGED
@@ -4,7 +4,7 @@ require:
|
|
4
4
|
- rubocop-minitest
|
5
5
|
|
6
6
|
AllCops:
|
7
|
-
TargetRubyVersion: 2.
|
7
|
+
TargetRubyVersion: 2.7
|
8
8
|
NewCops: enable
|
9
9
|
Exclude:
|
10
10
|
- bin/*
|
@@ -27,7 +27,7 @@ Lint/AssignmentInCondition:
|
|
27
27
|
Enabled: false
|
28
28
|
|
29
29
|
Lint/MissingSuper:
|
30
|
-
Exclude:
|
30
|
+
Exclude:
|
31
31
|
- lib/panchira/resolvers/*
|
32
32
|
|
33
33
|
Style/AsciiComments:
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
6
6
|
|
7
|
+
## 1.4.0 - 2022-01-10
|
8
|
+
### Added
|
9
|
+
- Added support for non-Japanese pixiv URLs.
|
10
|
+
|
11
|
+
### Fixed
|
12
|
+
- Fixed an issue where Nijie Resolver failed to fetch image.
|
13
|
+
|
14
|
+
### Changed
|
15
|
+
- Dropped support for Ruby 2.6.
|
16
|
+
|
7
17
|
## 1.3.6 - 2021-10-19
|
8
18
|
### Added
|
9
19
|
- Added support for Twitter.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
panchira (1.
|
4
|
+
panchira (1.4.0)
|
5
5
|
fastimage (~> 2.1.7)
|
6
6
|
nokogiri (>= 1.10.9, < 1.13.0)
|
7
7
|
|
@@ -11,12 +11,12 @@ GEM
|
|
11
11
|
ast (2.4.2)
|
12
12
|
fastimage (2.1.7)
|
13
13
|
minitest (5.14.4)
|
14
|
-
nokogiri (1.
|
14
|
+
nokogiri (1.12.5-x86_64-darwin)
|
15
15
|
racc (~> 1.4)
|
16
16
|
parallel (1.20.1)
|
17
17
|
parser (3.0.1.1)
|
18
18
|
ast (~> 2.4.1)
|
19
|
-
racc (1.
|
19
|
+
racc (1.6.0)
|
20
20
|
rainbow (3.0.0)
|
21
21
|
rake (12.3.3)
|
22
22
|
regexp_parser (2.1.1)
|
@@ -26,17 +26,17 @@ module Panchira
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def parse_image_url
|
29
|
-
str = @page.css('//script[@type="application/ld+json"]/text()').first.to_s
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
29
|
+
str = @page.css('//script[@type="application/ld+json"]/text()').first.to_s.split.join(' ')
|
30
|
+
thumbnail_url = JSON.parse(str)['thumbnailUrl']
|
31
|
+
|
32
|
+
unless thumbnail_url
|
33
|
+
return @page.css('//meta[property="og:image"]/@content').first.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
if md = thumbnail_url.match(%r{pic.nijie.net/\w+(?<resolution>/\w+/)nijie.+\.(?<format>png|jpg|jpeg)})
|
37
|
+
thumbnail_url.sub(md[:resolution], '/')
|
38
38
|
else
|
39
|
-
|
39
|
+
thumbnail_url
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
data/lib/panchira/version.rb
CHANGED
data/panchira.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ['lib']
|
33
33
|
|
34
|
-
spec.required_ruby_version = '>= 2.
|
34
|
+
spec.required_ruby_version = '>= 2.7'
|
35
35
|
|
36
36
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
37
37
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panchira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kyp
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -166,14 +166,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version: '2.
|
169
|
+
version: '2.7'
|
170
170
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
171
|
requirements:
|
172
172
|
- - ">="
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
176
|
+
rubygems_version: 3.3.4
|
177
177
|
signing_key:
|
178
178
|
specification_version: 4
|
179
179
|
summary: A parser for hentai websites
|