Tyrrrz / Tyrrrz/YoutubeExplode

Occasionally streams are very slow to download (`n`-sig deciphering)

Open
#706 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug bug/caused by youtube help wanted
Dominant language
C#
Stars
3.7k
Forks
592
Avg merge
3h 4m
Merged PRs (30d)
1

Description

Version

v6.2.13 / master

Details

When using the TVHTML5_SIMPLY_EMBEDDED_PLAYER client (or any other JS-enabled client, but this is the one we're using), occasionally YouTube may return a stream that has the n parameter. This parameter is an encrypted signature, similar to sig, but is responsible for rate throttling.

It also incorporates much more complicated cipher functions, so the existing deciphering code will not be enough to tackle it.

Currently, these kinds of streams are not too common, but I assume they will become more prolific as time goes on. It's not a huge issue now as the TVHTML5_SIMPLY_EMBEDDED_PLAYER client is only used for age-restricted videos.

Steps to reproduce

Updated, much more consistent steps to reproduce that require a VPN:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the slow download in Demo.Gui using an age-restricted video, then inspect the resolved stream manifest for the n parameter and the existing deciphering path. Test with the video IDs in TestData/VideoIds.cs and confirm that streams containing n download without severe throttling.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking, reverse-engineering
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.