ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.48k stars 10.04k forks source link

Site support request: cafe.naver.com #29285

Open git-test02 opened 3 years ago

git-test02 commented 3 years ago

Checklist

Example URLs

Description

WRITE DESCRIPTION HERE [debug] Command-line args: ['-f', 'https://cafe.naver.com/fakesoul/105792'] [debug] Encodings: locale cp932, fs mbcs, out cp932, pref cp932 [debug] youtube-dl version 2021.06.06 [debug] Python version 3.4.4 (CPython) - Windows-10-10.0.19043 [debug] exe versions: ffmpeg 2021-06-09-git-e01bf559df-full_build-www.gyan.dev, ffprobe 2021-06-09-git-e01bf559df-full_build-www.gyan.dev Unsupported URL: https://cafe.naver.com/fakesoul/105792

wajhk commented 3 years ago
wajhk commented 3 years ago

Welcome My brother

SuperSonicHub1 commented 3 years ago

@git-test02 Do you have more example URLs?

SuperSonicHub1 commented 3 years ago

How to Crack Naver Cafe

Terminology

Naver Cafe seems to be a collection of forums called "cafes", a la Reddit and its "subreddits". Cafes are referred to internally as "clubs". Posts are referred to as "articles".

Parse article ID and club ID

https://cafe.naver.com/fakesoul/105792
https://cafe.naver.com/<cafe>/<id>
== OR ==
https://cafe.naver.com/fakesoul?iframe_url_utf8=/ArticleRead.nhn%3Farticleid=105792%26clubid=25227043
https://cafe.naver.com/<cafe>?iframe_url_utf8=/ArticleRead.nhn%3Farticleid=<id>%26clubid=<clubid>
== OR ==
https://cafe.naver.com/ca-fe/ArticleRead.nhn?articleid=105792&clubid=25227043
https://cafe.naver.com/ca-fe/ArticleRead.nhn?articleid=<id>&clubid=<clubid>

Get club ID if we don't already have it

If we aren't able to initially parse a club ID, we need to get it from the webpage given to youtube-dl. Luckily, the club ID is littered across the HTML, but this one example should suffice for now:

r"var g_sClubId = \"(.*)\";"

Get initial info about the article

Don't know if I'll implement the extractor myself, but I hope my research is of use to anyone that does.

SuperSonicHub1 commented 3 years ago

@git-test02 Do you have more URLs with videos?