Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid yt url: signature tag name is not always "signature" #163

Merged
merged 2 commits into from May 14, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -888,7 +888,7 @@ private Map<String, ItagItem> getItags(String encodedUrlMapKey, ItagItem.ItagTyp
String streamUrl = tags.get("url");
// if video has a signature: decrypt it and add it to the url
if (tags.get("s") != null) {
streamUrl = streamUrl + "&signature=" + decryptSignature(tags.get("s"), decryptionCode);
streamUrl = streamUrl + "&" + tags.get("sp") + "=" + decryptSignature(tags.get("s"), decryptionCode);
Copy link
Member

Choose a reason for hiding this comment

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

Thanks! I'd like to include this into 0.16.2 so we can get this fix out asap. Can we ensure that tags.get("sp") != null? If this is the case, we are good to go. Otherwise, I'd suggest to use streamUrl = streamUrl + "&signature=" + decryptSignature(tags.get("s"), decryptionCode); as fallback if tags.get("sp") == null.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I'll implement and test it this evening

}
urlAndItags.put(streamUrl, itagItem);
}
Expand Down