PolyV (Version 11, 12, 13, Mp4) Downloader written in C#
Make sure you've got all Native AOT Prerequisities installed. Then run:
dotnet publish -c ReleaseThe downloader requires both a PolyV video URI and optionally a token found in the network tab (for HLS):
- Video URI: In the URL of this request:
https://player.polyv.net/secure/<HERE>.json - Token: In the URL query of this request:
https://hls.videocc.net/playsafe/../../../...key?token=<HERE>
Then run (HLS):
PolyVGet 4e75d3d997e444a48be3913c77d1c8d8_4 85fc0eb0-c3ce-4c80-84ef-dbb3aa1cab99-t0or for Mp4:
PolyVGet 4e75d3d997e444a48be3913c77d1c8d8_4Important
The downloader will inform you to use v13text.exe for playback for v13 videos. Read this for more info.
There are two methods of playing these videos:
- v13test.exe, a tool taken from a thread on 52PoJie.cn that can play downloaded files without any issues. This is only a player and conversion to a playable video format using this program is not possible. To play, run
v13test.exeand enter the file path to the downloaded video. mpv will open, allowing you to play the video normally. This program was originally written in Python and then compiled to C using Nuitka, making .pyc file recovery impossible. - PolyVGet-ffmpeg, a modified version of ffmpeg to match the changes made to the wasm runtime in the browser. This would obviously be my preferred option since its code is public, but I have not been able to reverse engineer it 100%. This leads to about 1 in 1000 B/P frames to be corrupt (?) when re-encoding. The re-implementation will use libavcodec's decoder to read the H.264 data and x264 to encode it to a playable video. Technically, the video data is not actually encoded differently but only moved around in the file, but since there is no such option we need to completely re-encode the file. To do this, run
ffmpeg.exe -y -i <downloaded file> -c:v libx264 -c:a copy <output file>. If you want to help with reverse engineering, use libpolyvffmpeg.so (from the Wingfox Android App) because it still contains functions names.