omansak / libvideo

A lightweight .NET library to download YouTube videos.
BSD 2-Clause "Simplified" License
553 stars 164 forks source link

Help Wanted | Descramble "N" Signature | Slow Download #270

Open omansak opened 1 year ago

omansak commented 1 year ago

I decided to remove JS Engine and add native code/algorith for DescrambleNSignature.

Code File : https://github.com/omansak/libvideo/blob/master/src/libvideo/YoutubeVideo.Descramble.cs

Examples : https://github.com/pytube/pytube/blob/d3d18691b3e99b2d3b4d620446b088a1c32896c6/pytube/cipher.py#L48 https://github.com/anxdpanic/plugin.video.youtube/blob/0120ae212d958ff93e8e937f378d28654d22dc5b/resources/lib/youtube_plugin/youtube/helper/ratebypass/ratebypass.py#L419 https://code.videolan.org/videolan/vlc/-/blob/master/share/lua/playlist/youtube.lua

Test Branch : https://github.com/omansak/libvideo/tree/descramble-n

References : https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-894619419 https://github.com/pytube/pytube/blob/fc9aec5c35829f2ebb4ef8dd599b14a666850d20/pytube/cipher.py