-
Notifications
You must be signed in to change notification settings - Fork 425
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
Use immutable Map factory methods. #986
Conversation
Isira-Seneviratne
commented
Nov 27, 2022
- I carefully read the contribution guidelines and agree to them.
- I have tested the API against NewPipe.
public static Map<String, List<String>> getYouTubeHeaders() | ||
throws ExtractionException, IOException { | ||
final var headers = getClientInfoHeaders(); | ||
headers.put("Cookie", List.of(generateConsentCookie())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the downloader might need to add cookies, e.g. recaptcha cookies. Would it be able to do so with List.of()
? I might be wrong on this though, since NewPipe itself does not actually modify the headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong on this though, since NewPipe itself does not actually modify the headers.
You're likely right, that's how we do also it on Piped:
|| isTvHtml5SimplyEmbeddedPlayerStreamingUrl(baseStreamingUrl); | ||
final boolean isAndroidStreamingUrl = isAndroidStreamingUrl(baseStreamingUrl); | ||
final boolean isIosStreamingUrl = isIosStreamingUrl(baseStreamingUrl); | ||
final boolean isHtml5StreamingUrl = YoutubeParsingHelper.isWebStreamingUrl(baseStreamingUrl) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you changing imports? This is an unrelated change, and also related to personal preference, so it should be avoided. Also in other files. Please undo it.
3028e96
to
9c23326
Compare
Wait: since you turned a
|
4fa5ff0
to
c70e29e
Compare
What did you do? I think it was perfectly ok to have |
I switched to the old behavior of having the referrer exclude the URL protocol. I wasn't sure if including it would cause issues 😅
Oh, okay. In that case, shall I undo the latest change? |
Yes |
c70e29e
to
9c23326
Compare
92d812d
to
d8ce08d
Compare
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java
Outdated
Show resolved
Hide resolved
…youtube/YoutubeParsingHelper.java