Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[webtoons] Use swebtoon-phinf.pstatic.net instead of webtoon-phinf.pstatic.net #2005

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

SuperSonicHub1
Copy link
Contributor

We'll be using this chapter as an example:
https://www.webtoons.com/en/thriller/school-bus-graveyard/episode-18/viewer?title_no=2705&episode_no=18

This neat trick actually comes from Webtoon's RSS feeds, where a
Referer header is unrealistic. Here's the RSS feed:
https://www.webtoons.com/en/thriller/school-bus-graveyard/rss?title_no=2705
They use URLs like this:

https://swebtoon-phinf.pstatic.net/20210929_12/1632867976494qzHhY_JPEG/16328679717202705189.jpg

The image links Webtoon's online client use URLs like this:

https://webtoon-phinf.pstatic.net/20210929_12/1632867976494qzHhY_JPEG/16328679717202705189.jpg?type=q90

Look familiar?

Yes, you only need to change the domain of your URL from
webtoon-phinf.pstatic.net to swebtoon-phinf.pstatic.net, a difference
of one character, to be able to embed Webtoon images anywhere. This
isn't limited to just the two images an RSS feed item has. Here's
another image from the same chapter much further down the page:

https://webtoon-phinf.pstatic.net/20210929_153/1632867980912DmcGK_JPEG/16328679808882705182.jpg?type=q90

https://swebtoon-phinf.pstatic.net/20210929_153/1632867980912DmcGK_JPEG/16328679808882705182.jpg?type=q90

With this, the doors have been blown open.

If this ever changes, previous behavior can be easily restored using git revert due to this patch's small size.

@SuperSonicHub1
Copy link
Contributor Author

Also, it would be heavily appreciated if you guys could make a CONTRIBUTING.md; I don't know how to run tests on my own system and I had to look at previous commits to see the convention for messages.

…tatic.net

This trick to avoid having to set a Referer header comes from
Webtoon's RSS feeds. The two URLs below are equivalent in content:

https://webtoon-phinf.pstatic.net/20210929_153/1632867980912DmcGK_JPEG/16328679808882705182.jpg?type=q90
https://swebtoon-phinf.pstatic.net/20210929_153/1632867980912DmcGK_JPEG/16328679808882705182.jpg?type=q90

The URL with the domain "webtoon-phinf.pstatic.net" needs a Referer
header, and the domain "swebtoon-phinf.pstatic.net" does not. This
is because of the environment "swebtoon" images live in, one without
explicit network control: RSS feeds on sites such as Feedly. This change should
make it easier for gallery-dl developers to embed Webtoon comics without
worrying about headers.
@mikf mikf merged commit a14b72b into mikf:master Nov 11, 2021
@SuperSonicHub1
Copy link
Contributor Author

SuperSonicHub1 commented Nov 11, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants