Skip to content
This repository was archived by the owner on Sep 28, 2020. It is now read-only.

Conversation

@toolboc
Copy link

@toolboc toolboc commented Apr 3, 2017

*Various optimizations
*Decipherer follows strategy employed by
https://github.com/gantt/downloadyoutube
*Resolves #242

This Decipherer is based on https://github.com/gantt/downloadyoutube which was one of the very first MP4 download scripts that took on encrypted video signatures. It is also one of the fastest to update during breaking changes. If we shift to the strategy employed by @gantt , we can benefit from these properties if/when things break again.

*Various optimizations
*Decipherer follows strategy employed by
https://github.com/gantt/downloadyoutube
Copy link
Contributor

@jphellemons jphellemons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add an if statement to catch if the regex does not match. I had a non matching regex on line 23 for signatureFunctionName so I modified the FindMatch https://github.com/toolboc/YoutubeExtractor/blob/cc80466d708aa4d475b7a9917d726d0c62812d37/YoutubeExtractor/YoutubeExtractor/Decipherer.cs#L125

@jphellemons
Copy link
Contributor

or remove the if and make it a one-liner with return matches.Count > 0 ? matches[0].Groups[1].Value : string.Empty;

private static string FindMatch(string text, string regexp)
{
    Regex rgx = new Regex(regexp);
    var matches = rgx.Matches(text);

    if (matches.Count > 0)
        return matches[0].Groups[1].Value;
    else
        return string.Empty;
}

@jphellemons
Copy link
Contributor

#296 #301

@toolboc
Copy link
Author

toolboc commented Mar 21, 2018

*feedback addressed in 75564dd

@jphellemons , please let me know if you see anything else =)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants