Albert Yi
f6a11e6363
remove residual code
2019-02-25 14:46:43 -08:00
Albert Yi
90ce42a537
add support for nico seiga manga ( fixes #4060 )
2019-02-25 14:44:45 -08:00
evazion
8cadef2dd7
pixiv: fix illust id parsing ( fix #4043 ).
...
* Tighten up illust id parsing to avoid misparsing ids from
non-illust urls (sketch urls and novel urls).
* Move id parsing tests from post_test.rb to sources/pixiv_test.rb.
* Drop support for touch.pixiv.net urls. These urls are no longer used
by Pixiv and aren't present as the source of any posts on Danbooru.
2019-01-13 14:28:51 -06:00
evazion
04d5b16da7
pixiv: fix failure to upload bad pixiv id images ( fix #4031 )
...
Bug: Uploading bad pixiv id images failed because the pixiv strategy
raised a BadIDError exception when the upload service checked for the
ugoira frame data.
2019-01-03 18:01:20 -06:00
evazion
6a77b68b74
tumblr: fix tests.
2018-12-27 15:03:11 -06:00
evazion
0f513d1a1b
twitter: include intent url in new artist entries ( #4028 ).
2018-12-27 15:03:11 -06:00
evazion
2129e60b2b
pixiv: include stacc url in new artist entries ( #4028 ).
2018-12-27 15:03:11 -06:00
evazion
c700ea4b5f
Fix #4016 : Translated tags failing to find some tags.
...
* Normalize spaces to underscores when saving other names. Preserve case
since case can be significant.
* Fix WikiPage#other_names_include to search case-insensitively (note:
this prevents using the index).
* Fix sources to return the raw tags in `#tags` and the normalized tags
in `#normalized_tags`. The normalized tags are the tags that will be
matched against other names.
2018-12-16 11:37:57 -06:00
evazion
fd2d56a388
Fix #3996 : Some direct artstation urls cause the bookmarklet to fail.
...
* Don't fail on urls that don't contain the project id (direct image urls).
* Don't fail when the work is deleted.
* Parse artist name from url when possible. This way the artist finder works on bad_artstation_id posts.
* Set canonical source url to `https://artist.artstation.com/projects/12345 ` instead of
`https://www.artstation.com/artwork/1235 ` (this way we preserve the artist name).
* Cache api call.
* Include api call results in /source.json.
2018-12-03 15:48:29 -06:00
evazion
e8c3d92696
Fix #3977 : DeviantArt: Support new wixmp.com urls.
2018-11-30 00:10:59 -06:00
evazion
8da3474a8b
Fix #3994 : Some deviantart images mistakenly choosing preview image.
2018-11-29 23:01:08 -06:00
evazion
bea8c2a4b8
nijie: fix failure to handle certain image urls.
...
Fix IMAGE_URL regex not matching urls of this form:
* https://pic04.nijie.info/nijie_picture/diff/main/287736_161475_20181112032855_1.png
This caused the illust id to not be parsed from the url, which led to `#image_url`
returning nil, which led to uploads failing because the url to download was missing.
2018-11-12 18:04:07 -06:00
evazion
8f6c710c6b
tests: fix translated tags test failures.
2018-11-12 18:04:07 -06:00
evazion
6a7cd6ce8e
Fix #3984 : Twitter: undefined method `first' for nil:NilClass.
...
Fix Sources::Strategies::Twitter#image_urls to return an empty array
instead of nil when the tweet doesn't contain any images.
2018-11-11 17:41:32 -06:00
evazion
5cf6a43918
sources: fix sources sometimes choosing wrong strategy ( fix #3968 )
...
Fix sources choosing the wrong strategy when the referer belongs to a
different site (for example, when uploading a twitter post with a pixiv
referer).
* Fix `match?` to only consider the main url, not the referer.
* Change `match?` to match against a list of domains given by the `domains` method.
* Change `match?` to an instance method.
2018-11-04 13:00:17 -06:00
evazion
53a51310a3
tumblr: add canonical url tests ( #3385 ).
2018-10-09 12:55:48 -05:00
evazion
16b1b72da5
tumblr: fix video urls not being recognized.
2018-10-09 12:44:59 -05:00
evazion
184a5ebf3e
tumblr: fix _640 images not being recognized ( #3944 ).
...
Fixes _640 images not being matched by the IMAGE regex and therefore not
being rewritten to the largest size.
2018-10-09 12:44:59 -05:00
evazion
d874c68419
tumblr: fix image_urls when api data is unavailable.
2018-10-09 12:44:59 -05:00
evazion
b0d7d90103
tumblr: extract info from url when api data is unavailable.
...
Derive the artist name / profile url / page url from the source URLs when
the API response is unavailable because the Tumblr post was deleted.
This fixes the artist finder to work on bad_tumblr_id posts.
2018-10-09 12:44:59 -05:00
evazion
0c31a5d6a9
tumblr: don't fail when api data is unavailable ( #3948 ).
...
The api data is unavailable when the work is deleted (bad_tumblr_id), or
when the source is a direct image url with no page referer.
2018-10-09 12:44:59 -05:00
evazion
4c55c809b0
tumblr: don't fail when api key isn't configured.
2018-10-09 12:44:59 -05:00
evazion
c8d538f618
moebooru: delegate to substrategy based on post source ( #3911 ).
...
If the yande.re or konachan.com post has a source from a supported site,
for example Pixiv or Twitter, then delegate the artist and commentary
lookup to that substrategy.
Only do this for sources from recognized sites, not the null strategy.
2018-10-06 14:27:49 -05:00
evazion
e5a4193dd4
moebooru: support batch bookmarklet previews ( #3911 ).
2018-10-06 00:58:22 -05:00
evazion
fdb6e4ecee
moebooru: rewrite konachan urls for Post#normalized_source ( #3911 ).
2018-10-06 00:58:22 -05:00
evazion
864349dc7b
moebooru: fetch tags ( #3911 ).
2018-10-06 00:58:22 -05:00
evazion
bd3fb7d70e
Post#normalized_source: fix for yande.re urls.
...
Fix regex for yande.re urls like this:
https://files.yande.re/image/b66909b940e8d77accab7c9b25aa4dc3/yande.re%20377828.png
2018-10-01 20:03:21 -05:00
evazion
d9063a9f2a
nijie: support preview urls ( #3919 ).
2018-09-24 17:08:37 -05:00
evazion
5525bbe1ca
nijie: normalize all thumbnail urls ( #3919 ).
2018-09-23 20:08:14 -05:00
evazion
d294514dc0
nijie: don't crash on invalid urls or deleted works ( #3919 ).
2018-09-23 20:08:14 -05:00
evazion
b6228505aa
nijie: fix page_url method.
...
The id in a bare image url is the member id, not the illust id.
2018-09-23 20:08:13 -05:00
evazion
39f9e01b13
nicoseiga: fix canonical_url to use the image url.
2018-09-22 11:07:18 -05:00
evazion
958a9f505b
moebooru: rewrite sample urls + support bookmarklet on html page.
...
* Fixes #2942 : Add Moebooru Rewrite for Sample Images.
* Addresses #3911 : Improve Moebooru support.
2018-09-19 23:32:21 -05:00
evazion
96e89cecfb
tests: move twitter canonical url test.
2018-09-17 23:27:53 -05:00
evazion
4a99cb098f
moebooru: use the image url as the canonical url.
2018-09-16 21:00:11 -05:00
evazion
d9ce953752
Fix #3906 : Moebooru strategy raises NotImplementedError.
2018-09-16 21:00:11 -05:00
evazion
cae78fa8ee
moebooru: move tests from unit/downloads to unit/sources.
2018-09-16 21:00:11 -05:00
evazion
f135a7c064
twitter: normalize canonical urls.
...
Normalize http://mobile.twitter.com to http://twitter.com in canonical urls.
2018-09-16 15:03:47 -05:00
evazion
bd47641601
twitter: don't fail when api key isn't configured.
2018-09-16 15:03:47 -05:00
evazion
325120ee51
twitter: fix parsing of the artist name from the url.
...
Fixes URLs like https://twitter.com/intent/user?user_id=123 being
incorrectly normalized to http://twitter.com/intent/ in artist entries.
Also fixes the artist name to be taken from the url when it can't be
obtained from the api (when the tweet is deleted).
2018-09-16 15:03:23 -05:00
evazion
fbd5f6b7f2
pixiv: fix preview_urls for ugoiras ( #3891 ).
2018-09-12 00:43:10 -05:00
evazion
37fc215d75
pixiv: fix preview_urls to use correct url ( #3891 ).
2018-09-11 23:55:46 -05:00
Albert Yi
a5df178bcc
Merge pull request #3886 from r888888888/source-api-caching
...
cache api clients
2018-09-11 17:34:25 -07:00
Albert Yi
4972c998f8
rely on preview urls if available for gallery
2018-09-11 15:06:12 -07:00
Albert Yi
266c7c0d5b
cache api clients
2018-09-11 14:19:17 -07:00
evazion
9a980367f6
twitter: normalize artist commentaries to nfkc ( #3719 )
...
Fixes hashtags not being interpreted when the author uses a fullwidth
number sign (#, U+FF03).
ref: https://github.com/r888888888/danbooru/issues/3719#issuecomment-419535610
2018-09-10 21:45:50 -05:00
evazion
c9300cc54e
sta.sh: add tests + docs.
2018-09-10 19:26:53 -05:00
evazion
a67edb8783
deviantart: fix artist finder for artist names with underscores.
...
Fix the artist finder for urls like this:
https://orig00.deviantart.net/4274/f/2010/230/8/a/pkmn_king_and_queen_by_mikoto_chan.jpg
that don't contain a deviantart id but do contain the artist name.
2018-09-07 12:23:48 -05:00
evazion
610391205f
deviantart: fix artist finder for profile urls missing the 'www'.
...
Fix the artist finder to work when the profile url in the artist entry
is missing the 'www'. Example:
https://deviantart.com/noizave
https://www.deviantart.com/noizave
2018-09-07 11:36:48 -05:00
evazion
e37844303d
deviantart: take artist name from url when unavailable from API.
...
In some cases we can't get the artist name from the API, either because
we can't do the API call because the url doesn't contain a deviation id,
or because the work is deleted:
* http://fc08.deviantart.net/files/f/2007/120/c/9/cool_like_me_by_47ness.jpg (work: http://fav.me/dwcohb )
* https://pre00.deviantart.net/423b/th/pre/i/2017/281/e/0/mindflayer_girl01_by_nickbeja-dbpxdt8.png (work: http://fav.me/dbpxd58 )
Switch to taking the artist name from the url (when present) to deal
with these cases. Fixes the artist finder and the artist url normalizer
to work in this situation.
2018-09-03 18:27:01 -05:00