33import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getAndroidUserAgent ;
44import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getIosUserAgent ;
55import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getOriginReferrerHeaders ;
6- import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .getTvHtml5UserAgent ;
76import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .isAndroidStreamingUrl ;
87import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .isIosStreamingUrl ;
9- import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .isTvHtml5StreamingUrl ;
108import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .isWebStreamingUrl ;
119import static org .schabi .newpipe .extractor .services .youtube .YoutubeParsingHelper .isWebEmbeddedPlayerStreamingUrl ;
1210import static org .schabi .newpipe .extractor .utils .Utils .isNullOrEmpty ;
@@ -604,9 +602,7 @@ public static Response getInitializationResponse(@Nonnull String baseStreamingUr
604602 @ Nonnull final ItagItem itagItem ,
605603 final DeliveryType deliveryType )
606604 throws CreationException {
607- final boolean isTvHtml5StreamingUrl = isTvHtml5StreamingUrl (baseStreamingUrl );
608605 final boolean isHtml5StreamingUrl = isWebStreamingUrl (baseStreamingUrl )
609- || isTvHtml5StreamingUrl
610606 || isWebEmbeddedPlayerStreamingUrl (baseStreamingUrl );
611607 final boolean isAndroidStreamingUrl = isAndroidStreamingUrl (baseStreamingUrl );
612608 final boolean isIosStreamingUrl = isIosStreamingUrl (baseStreamingUrl );
@@ -620,7 +616,7 @@ public static Response getInitializationResponse(@Nonnull String baseStreamingUr
620616 final String mimeTypeExpected = itagItem .getMediaFormat ().getMimeType ();
621617 if (!isNullOrEmpty (mimeTypeExpected )) {
622618 return getStreamingWebUrlWithoutRedirects (downloader , baseStreamingUrl ,
623- mimeTypeExpected , isTvHtml5StreamingUrl );
619+ mimeTypeExpected );
624620 }
625621 } else if (isAndroidStreamingUrl || isIosStreamingUrl ) {
626622 try {
@@ -735,8 +731,6 @@ private static String appendRnSqParamsIfNeeded(@Nonnull final String baseStreami
735731 * @param downloader the {@link Downloader} instance to be used
736732 * @param streamingUrl the streaming URL which we are trying to get a streaming URL
737733 * without any redirection on the network and/or IP used
738- * @param isTvHtml5StreamingUrl whether the streaming URL comes from TVHTML5 client, in
739- * order to use an appropriate HTTP User-Agent header
740734 * @param responseMimeTypeExpected the response mime type expected from Google video servers
741735 * @return the {@link Response} of the stream, which should have no redirections
742736 */
@@ -745,15 +739,11 @@ private static String appendRnSqParamsIfNeeded(@Nonnull final String baseStreami
745739 private static Response getStreamingWebUrlWithoutRedirects (
746740 @ Nonnull final Downloader downloader ,
747741 @ Nonnull String streamingUrl ,
748- @ Nonnull final String responseMimeTypeExpected ,
749- final boolean isTvHtml5StreamingUrl )
742+ @ Nonnull final String responseMimeTypeExpected )
750743 throws CreationException {
751744 try {
752745 final var headers = new HashMap <>(
753746 getOriginReferrerHeaders ("https://www.youtube.com" ));
754- if (isTvHtml5StreamingUrl ) {
755- headers .put ("User-Agent" , List .of (getTvHtml5UserAgent ()));
756- }
757747
758748 String responseMimeType = "" ;
759749
0 commit comments