Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eragmus/7d2db7107c8b4369ea53611f2298b251 to your computer and use it in GitHub Desktop.
Save eragmus/7d2db7107c8b4369ea53611f2298b251 to your computer and use it in GitHub Desktop.
How to download videos from Huajio (Chinese video hosting site)
1. Find the .m3u8 URL!
1a. Right-click on video page, select 'inspect element', then go to 'network' tab.
1b. Reload page and wait for video to load.
1c. Click on 'size' column to order by size of file.
1d. Wait for .ts files to begin appearing.
1e. Copy URLs of any 2 .TS files.
1f. Compare URLs, and observe for the common element of each URL.
e.g. http://vod.cdn.huajiao.com/huikan_huajiao/vod-bucket/_LC_RE_non_5631850814814417221756440_OX
1g. Change .ts extension to .m3u8 extension.
e.g. http://vod.cdn.huajiao.com/huikan_huajiao/vod-bucket/_LC_RE_non_5631850814814417221756440_OX.m3u8
2. Download and install ffmpeg.
3. Replace [.m3u8 URL] with the .m3u8 URL from step #1, in the following code:
ffmpeg -i "[.m3u8 URL]" -c copy -bsf:a aac_adtstoasc video.mp4
4. Enter the modified code from step #3 into Mac terminal / command line / etc.
5. Wait for your new video.mp4 file to be created...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment