mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-28 16:00:33 +05:30
[YouTube] Add signatureTimestamp argument to TVHTML5 client requests
This argument, which has been forgot, is required to get valid streaming URLs with this client.
This commit is contained in:
parent
61f67854ed
commit
4644e1744b
@ -119,7 +119,8 @@ public final class YoutubeStreamHelper {
|
|||||||
@Nonnull final Localization localization,
|
@Nonnull final Localization localization,
|
||||||
@Nonnull final ContentCountry contentCountry,
|
@Nonnull final ContentCountry contentCountry,
|
||||||
@Nonnull final String videoId,
|
@Nonnull final String videoId,
|
||||||
@Nonnull final String cpn) throws IOException, ExtractionException {
|
@Nonnull final String cpn,
|
||||||
|
final int signatureTimestamp) throws IOException, ExtractionException {
|
||||||
final InnertubeClientRequestInfo innertubeClientRequestInfo =
|
final InnertubeClientRequestInfo innertubeClientRequestInfo =
|
||||||
new InnertubeClientRequestInfo(
|
new InnertubeClientRequestInfo(
|
||||||
new InnertubeClientRequestInfo.ClientInfo(
|
new InnertubeClientRequestInfo.ClientInfo(
|
||||||
@ -154,6 +155,8 @@ public final class YoutubeStreamHelper {
|
|||||||
|
|
||||||
addVideoIdCpnAndOkChecks(builder, videoId, cpn);
|
addVideoIdCpnAndOkChecks(builder, videoId, cpn);
|
||||||
|
|
||||||
|
addPlaybackContext(builder, BASE_YT_DESKTOP_WATCH_URL + videoId, signatureTimestamp);
|
||||||
|
|
||||||
final byte[] body = JsonWriter.string(builder.done())
|
final byte[] body = JsonWriter.string(builder.done())
|
||||||
.getBytes(StandardCharsets.UTF_8);
|
.getBytes(StandardCharsets.UTF_8);
|
||||||
|
|
||||||
|
@ -941,7 +941,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||||||
|
|
||||||
final JsonObject tvHtml5PlayerResponse =
|
final JsonObject tvHtml5PlayerResponse =
|
||||||
YoutubeStreamHelper.getTvHtml5PlayerResponse(
|
YoutubeStreamHelper.getTvHtml5PlayerResponse(
|
||||||
localization, contentCountry, videoId, html5Cpn);
|
localization, contentCountry, videoId, html5Cpn,
|
||||||
|
YoutubeJavaScriptPlayerManager.getSignatureTimestamp(videoId));
|
||||||
|
|
||||||
if (isPlayerResponseNotValid(tvHtml5PlayerResponse, videoId)) {
|
if (isPlayerResponseNotValid(tvHtml5PlayerResponse, videoId)) {
|
||||||
throw new ExtractionException("TVHTML5 player response is not valid");
|
throw new ExtractionException("TVHTML5 player response is not valid");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user