Commit graph

1313 commits

Author SHA1 Message Date
TiA4f8R
2320aecb7c
Update mocks 2021-08-01 12:39:02 +02:00
TiA4f8R
629dcd63b2
Ignore some broken tests 2021-08-01 12:39:01 +02:00
TiA4f8R
3adac6a150
Workaround for rate limits: always use the Android mobile API 2021-08-01 12:39:01 +02:00
TiA4f8R
8aa60d7e8f
Update clients version 2021-08-01 12:39:01 +02:00
TiA4f8R
27bd797f1e
Update mocks 2021-08-01 12:39:01 +02:00
TiA4f8R
609919db59
Adress again reviews, fix some rebase issues 2021-08-01 12:39:00 +02:00
TiA4f8R
4299d806a2
Adress changes 2021-08-01 12:38:59 +02:00
TiA4f8R
1a6b8da438
Annotate YoutubeParsingHelper methods with Nonnull when needed 2021-08-01 12:38:59 +02:00
TiA4f8R
d8177b57f6
Loop in all formats to check if the stream has URLs protected by signatureCiphers 2021-08-01 12:38:59 +02:00
TiA4f8R
a6a2c6eb80
Revert the use of Collections.singletonList instead of Arrays.asList in addCookieHeader of YoutubeParsingHelper 2021-08-01 12:38:59 +02:00
TiA4f8R
81013e5a8e
Add a static method to reset the YouTube deobfuscation code and use it in tests
This method is needed for YouTube stream tests, because when all YouTube tests are ran, the signatureTimestamp is known (the sts string) so a different body than the body present in the mocks is send by the extractor instance.
As a result, running all YouTube stream tests with the MockDownloader (like the CI does) will fail if this method is not called before fetching the page of a test.
2021-08-01 12:38:58 +02:00
TiA4f8R
cc798523cd
Adress requested changes in other classes 2021-08-01 12:38:58 +02:00
TiA4f8R
accd5ddef3
Adress requested changes in YoutubeStreamExtractor 2021-08-01 12:38:58 +02:00
TiA4f8R
632772d17f
Adress requested changes in YoutubeParsingHelper 2021-08-01 12:38:58 +02:00
TiA4f8R
657f165771
Update client version and mocks 2021-08-01 12:38:44 +02:00
TiA4f8R
8c1c7281b0
Real fix of the fetch of the JS player at each the signatureTimestamp is required
The strings playerJsUrl, sts and playerCode are now static in order to don't fetch again the JavaScript player at each time the signatureTimestamp is needed.
2021-08-01 12:38:43 +02:00
TiA4f8R
e97a685989
Format the YoutubeMusicSearchExtractor class to be in the 100 characters per line limit 2021-08-01 12:38:43 +02:00
TiA4f8R
34a9ccb0fd
Adress requested changes 2021-08-01 12:38:42 +02:00
TiA4f8R
54d4551ca6
Adress requested changes in YoutubeParsingHelper and update mobile client version 2021-08-01 12:38:42 +02:00
TiA4f8R
a59c2a3577
Catch every exception instead of only IOException and ExtractionException and add a Javadoc
Catch every exception instead of only IOException and ExtractionException.
Add JavaDoc for fetchAndroidMobileJsonPlayer method of YoutubeStreamExtractor
2021-08-01 12:38:42 +02:00
TiA4f8R
6921e80ded
Try again to don't fetch at each time the JavaScript player 2021-08-01 12:38:42 +02:00
TiA4f8R
70927ddade
Update client version and mocks 2021-08-01 12:38:40 +02:00
TiA4f8R
318bc46a8c
Readd the deleted code of views because watching count of livestreams was broken
The number shown was the total number of views that a livestream has. In order to fix this bug, the previous code is readded.
2021-08-01 12:38:39 +02:00
TiA4f8R
947baec805
Fetch again the desktop player JSON only if the content is protected by signatureCiphers 2021-08-01 12:38:39 +02:00
TiA4f8R
7474049fd1
Update mocks 2021-08-01 12:38:39 +02:00
TiA4f8R
c32bc6e534
Try to don't fetch again the first page when requesting a channel continuation
Try to don't fetch again the first page of a YouTube channel when requesting a continuation of it by trying to store the channel name and the channel id into the next page using the ids field of the Page class.
2021-08-01 12:38:38 +02:00
TiA4f8R
b52732a1c3
Fix the fetch of the playerCode at each time getStsFromPlayerJs is called
storePlayerJs was called even if sts was not empty in the getStsFromPlayerJs method. This commit fixes it.
2021-08-01 12:38:37 +02:00
TiA4f8R
ae5abc0c5d
Fix a typo in YoutubeChannelExtractor 2021-08-01 12:38:37 +02:00
TiA4f8R
0f9e9b8b4b
Use the youtubei API for YouTube mixes + update the corresponding test + do some improvements
Use the youtubei API for YouTube mixes. The corresponding has been updated because the new API breaks the tests of YoutubeMixPlaylistExtractorTest.
Remove some deprecated code (the old search code with the pbj JSON) and do some other improvements.
2021-08-01 12:38:37 +02:00
TiA4f8R
14569c4aa9
Readd the return of itags 134 and 136 2021-08-01 12:38:37 +02:00
TiA4f8R
3017dde67e
Fix some typos 2021-08-01 12:38:36 +02:00
TiA4f8R
013b902535
Use the Android mobile API when there are OTF streams or the content is protected by signatureCiphers
Use the Android mobile API to get the itag 22 (720p with audio), removed when the content is protected by signatureCiphers.
Also use this API when they are OTF streams, to get the itag 17 and 36, low 3GPP quality streams but also the itag 139.
Update the web client version.
2021-08-01 12:38:36 +02:00
TiA4f8R
e7d589edbf
Use the youtubei API for YouTube videos + update client version
Update the hardcoded client version to 2.20210520.09.00
Use the player and next endpoints of the Innertube API for YouTube videos
2021-08-01 12:38:36 +02:00
TiA4f8R
f73c923f60
Don't use the youtubei.googleapis.com but the websites domains + update client version of the desktop internal API
Use again www.youtube.com and music.youtube.com domains instead of youtubei.googleapis.com domain because it spoofs more a web client of YouTube or YouTube Music and may reduce Google's detection of NewPipe Extractor users.
2021-08-01 12:38:34 +02:00
TiA4f8R
effcdaa4f2
Update mocks, reenable a test and fix a test
This commit updates mocks and reenables the test invalidId of the NotAvailable class of the YoutubePlaylistExtractorTest class beacuse with the youtubei/innertube API, it returns "Not found" and doesn't redirect to the YouTube homepage.
The expectedMetaInfo test of the MetaInfoTest class of the YoutubeSearchExtractorTest class was broken because YouTube removes the vaccine progress link of the WHO from the meta info so this commit removes it and the test is now passing.
2021-08-01 12:38:04 +02:00
TiA4f8R
4d682834c3
Fix localization and update client version 2021-08-01 12:38:03 +02:00
TiA4f8R
f46cfb0f26
Adress reviews and do some improvements
Adress changes requested in reviews.
Do some improvements, remove unused imports and format some code to be in the 100 characters line limit.
2021-08-01 12:38:03 +02:00
TiA4f8R
e075dd5a63
Update client version, fix some tests, update mocks and do some improvements
Add the origin and the referer headers with the https://www.youtube.com value for YouTube JSON POST requests.
Don't add the consent cookie header for the requests which use the youtubei/innertube API because it's uneeded.
Fix some tests and update YouTube mocks
2021-08-01 12:38:02 +02:00
TiA4f8R
b49ae547a3
Do some improvements to YoutubeStreamExtractor
Get the real name of the uploader (for autogenerated channels and music artist channels), like before the migration to the JSON pbj.
Do some other improvements, especially reformatting some code to be in the 100 characters line limit and use final where possible.
2021-08-01 12:38:01 +02:00
TiA4f8R
58ce9b04a1
Fix channel extraction when channel URL is youtube.com/c/username 2021-08-01 12:38:01 +02:00
TiA4f8R
991b2c7d73
Use lightweight requests when getting and checking YouTube API key and client version 2021-08-01 12:38:01 +02:00
TiA4f8R
9ab9c66ddf
Use the youtubei.googleapis.com domain for YouTube Music searches + change a check + update client version and mocks
Change the domain from music.youtube.com to youtubei.googleapis.com.
Use a lightweight request to check if the hardcoded YouTubeMusic keys are valid. Increase the length of the response to 500 because if the key is invalid, the length of the response returned is higher than 250 and the response when the key is valid is higher than 1500.
Format the YoutubeMusicSearchExtractor file.
Update YouTube web client version and mocks
2021-08-01 12:37:56 +02:00
TiA4f8R
77c031a88a
Use the youtubei API for YouTube trends 2021-08-01 12:36:28 +02:00
TiA4f8R
f461224b2b
Use the youtubei API for YouTube searches + update mocks
Add getSearchParameter, a new method in YoutubeSearchQueryHandlerFactory class which returns the params field for a search, or an empty string if there is no one.
Update mocks of YoutubeSearchExtractorTest.
2021-08-01 12:36:28 +02:00
TiA4f8R
a12c69da7d
Use the youtubei API for YouTube channels 2021-08-01 12:36:27 +02:00
TiA4f8R
5794eb2350
Use the youtubei API for YouTube playlists 2021-08-01 12:36:12 +02:00
Stypox
c97a19d719
Merge pull request #696 from XiangRongLin/decrypt_pattern
Expand regex to match n param decrypt function
2021-08-01 10:24:22 +02:00
XiangRongLin
37df225556 Remove length check from StringUtils.matchToClosingParenthesis 2021-07-31 16:05:24 +02:00
FireMasterK
f4aad8b014
Fix tests again. 2021-07-31 14:40:51 +05:30
FireMasterK
88c11db4c5
Fix isCorrectedSearch test. 2021-07-31 02:18:18 +05:30
FireMasterK
fd19c53f65
Fix search suggestions test. 2021-07-31 02:08:50 +05:30
FireMasterK
a685941bba
Fix YouTube music search. 2021-07-31 01:33:38 +05:30
XiangRongLin
852a65ff18 Add tests for StringUtils 2021-07-30 19:56:57 +02:00
XiangRongLin
48d897e6ad Add final and adjust utils class name 2021-07-29 21:33:45 +02:00
XiangRongLin
60794aea31 [YouTube] Add parenthesis matching as way to parse decrypt function
From @Stypox
2021-07-29 21:23:00 +02:00
XiangRongLin
2967d1ae6a [YouTube] Compile YoutubeThrottlingDecrypter pattern statically 2021-07-29 20:27:29 +02:00
XiangRongLin
1c78976900 [YouTube] Expand regex to match n param decrypt function
Temporary solution
2021-07-29 20:26:36 +02:00
TobiGr
b62fe7141e Fix JDoc 2 2021-07-29 12:34:04 +02:00
TobiGr
dbc4e01c17 Fix JDoc 2021-07-29 12:31:33 +02:00
TobiGr
8bfcb0ad59 [SoundCloud] Fix hardcoded client id 2021-07-28 20:33:21 +02:00
Tobi
027dc65434 pull request #683 from XiangRongLin/yt_throttling
[YouTube] Fix buffering by decoding n parameter of stream urls
2021-07-28 20:32:38 +02:00
Tobi
14c179f343
Merge pull request #692 from TeamNewPipe/fix/sc/id
[SoundCloud] Fix hardcoded client id
2021-07-28 18:28:07 +02:00
Tobi
394c02ad06
Merge pull request #683 from XiangRongLin/yt_throttling
[YouTube] Fix buffering by decoding n parameter of stream urls
2021-07-28 18:01:57 +02:00
TobiGr
785ff4aa32 [SoundCloud] Fix hardcoded client id 2021-07-28 17:02:56 +02:00
TobiGr
79f2d74b04 Fix test
The decryption code changes over time. Only check whether the n parameter was changed in the URL
2021-07-28 16:45:31 +02:00
TobiGr
d70adfdb8f Add methods for cache control to YoutubeThrottlingDecrypter. 2021-07-27 20:32:22 +02:00
TiA4f8R
d13f531b6f Use YoutubeThrottlingDecrypter also in getAudioStreams and getVideoOnlyStreams methods of YoutubeStreamExtractor
Without this commit, the n param is only decrypted for streams extracted in getVideoStreams (so only for streams in the formats object of the player response).
2021-07-27 17:28:32 +02:00
TiA4f8R
32055147e0 Do some code improvements
Use final where possible, annotate some methods and parameters as Nonnull and format new code to be in the 100 characters limit per line.
2021-07-27 17:24:27 +02:00
TobiGr
1c30a2725e Cache nParams to prevent executing the JavaScript function for the same nParam multiple times.
Closes #689
2021-07-22 19:40:12 +02:00
XiangRongLin
3a3d1d7f2b Make YoutubeJavaScriptExtractor and JavaScript methods static
Also address review and rewrite some comments
2021-07-20 20:48:11 +02:00
XiangRongLin
a683c8d278 Delete duplicated code to load youtube javascript file 2021-07-17 19:14:57 +02:00
XiangRongLin
a02ee2e952 Rewrite youtube throttling solution and add tests 2021-07-17 19:10:09 +02:00
litetex
0c12b396e5 Review changes 2021-07-17 16:41:12 +02:00
litetex
ecf4232ce3 Using `Collections.emptyList()` 2021-07-17 16:41:12 +02:00
litetex
0f9ed020a4 Frameset has to implement Serializable or NewPipe fails
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = org.schabi.newpipe.extractor.stream.StreamInfo)
...
Caused by: java.io.NotSerializableException: org.schabi.newpipe.extractor.stream.Frameset
...
2021-07-17 16:41:11 +02:00
litetex
17ccaf4b87 Update YoutubeStreamExtractor.java
To fix ``java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference``
2021-07-17 16:41:10 +02:00
litetex
4e41e172ea Update Frameset.java
Reformatted code
2021-07-17 16:41:10 +02:00
litetex
09b670d745 Renamed frames to previewFrames (so it's better understandable) 2021-07-17 16:41:09 +02:00
litetex
b086655d54 Reverted useless change 2021-07-17 16:41:08 +02:00
litetex
93b0c5b15f Added seekbar data 2021-07-17 16:41:08 +02:00
XiangRongLin
6956b72af7 Fix YoutubeThrottlingDecoder.replaceNParam
Previously it replaced the parameter itself not the value of the parameter.
2021-07-17 10:05:14 +02:00
XiangRongLin
a189f685dc cache player js code 2021-07-16 19:20:40 +02:00
XiangRongLin
fcdb9bdbeb add url to sout 2021-07-15 20:05:26 +02:00
XiangRongLin
80cf8b3acd Extract separate YoutubeThrottlingDecoder 2021-07-15 20:05:25 +02:00
XiangRongLin
a86a30103f [Youtube] bare bones version to solve throttling
Done by transforming the parameter "n" from videoplayback urls
https://github.com/ytdl-org/youtube-dl/issues/29326#issuecomment-865985377
2021-07-15 20:05:25 +02:00
c38a06e8dc
Merge pull request #661 from B0pol/peertube-livestreams
[PeerTube] Support livestreams
2021-07-13 15:48:13 +02:00
litetex
fdebf3c6cd Added javadoc warnings 2021-07-07 20:41:59 +02:00
litetex
6860543b07 Added more doc 2021-07-06 21:16:31 +02:00
litetex
a59fead0d7 Fixed typos 2021-07-06 21:16:30 +02:00
litetex
688a1c316b Fixed Exception when YT comments are disabled and added `commentsDisabled` field
* Fixed code: Added missing finals (according to NewPipes Checkstyle guide)
* Fixed ``findValue`` method in ``YoutubeCommentsExtractor``
2021-07-06 21:16:29 +02:00
litetex
ca33f4f60b Improved code format (final) and added `isCommentsDisabled` method 2021-07-06 21:16:28 +02:00
TobiGr
dbdc962a07 Update mocks 2021-07-03 13:30:26 +02:00
TobiGr
9ca6dc26ed Fix invalid CONSENT cookie value 2021-07-03 13:27:40 +02:00
XiangRongLin
b9549ace25 [Youtube] Fix lofi girl test and ignore mix with id test 2021-06-29 21:12:20 +02:00
XiangRongLin
5982431ffb Remove IPv4 addresses from response during mock recording 2021-06-29 21:03:33 +02:00
7d7cc087e2 [PeerTube] Support livestreams 2021-06-24 11:02:30 +02:00
3966178979
Merge pull request #665 from B0pol/agerestricted
[youtube] Fix extraction of age restricted videos
2021-06-23 21:07:14 +02:00
b475f09ba7 don't do useless concatenation 2021-06-23 20:33:32 +02:00
b96b2a6eba Update invidious instances 2021-06-23 14:39:10 +02:00
c5e8bd368d Update Mocks 2021-06-23 12:21:57 +02:00