Merge pull request #163 from Stypox/youtube-url-signature-fix
Fix invalid yt url: signature tag name is not always "signature"
This commit is contained in:
commit
acebbaf073
1 changed files with 7 additions and 1 deletions
|
@ -888,8 +888,14 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
||||||
String streamUrl = tags.get("url");
|
String streamUrl = tags.get("url");
|
||||||
// if video has a signature: decrypt it and add it to the url
|
// if video has a signature: decrypt it and add it to the url
|
||||||
if (tags.get("s") != null) {
|
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);
|
streamUrl = streamUrl + "&signature=" + decryptSignature(tags.get("s"), decryptionCode);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
streamUrl = streamUrl + "&" + tags.get("sp") + "=" + decryptSignature(tags.get("s"), decryptionCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
urlAndItags.put(streamUrl, itagItem);
|
urlAndItags.put(streamUrl, itagItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue