Add fallback for urls not conaining the "sp" tag
If ever YouTube changes thing again (or uses old urls for some unknown reason), this prevents the extractor from crashing. As suggested here: https://github.com/TeamNewPipe/NewPipeExtractor/pull/163/files/133cc032d9987130927e4c00e78e9fdbca1331dd#r283529811
This commit is contained in:
parent
133cc032d9
commit
c70d28597b
1 changed files with 7 additions and 1 deletions
|
@ -888,8 +888,14 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
String streamUrl = tags.get("url");
|
||||
// if video has a signature: decrypt it and add it to the url
|
||||
if (tags.get("s") != null) {
|
||||
if (tags.get("sp") == null) {
|
||||
// fallback for urls not conaining the "sp" tag
|
||||
streamUrl = streamUrl + "&signature=" + decryptSignature(tags.get("s"), decryptionCode);
|
||||
}
|
||||
else {
|
||||
streamUrl = streamUrl + "&" + tags.get("sp") + "=" + decryptSignature(tags.get("s"), decryptionCode);
|
||||
}
|
||||
}
|
||||
urlAndItags.put(streamUrl, itagItem);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue