Commit Graph

293 Commits

Author SHA1 Message Date
bopol e9a992b0a9 [youtube] Fix extraction of age restricted videos 2021-06-23 12:06:02 +02:00
Hassan Igbaria e8b5364745
Update YoutubeStreamExtractor.java 2021-05-21 16:22:24 +03:00
Fynn Godau 14f6f1b7c3 Generify related streams calls and rename method 2021-03-31 20:24:40 +02:00
bopol 8806fb4e6b
address reviews 2021-03-19 10:14:43 +01:00
bopol c47cc54908
Extract metadata for YouTube, SoundCloud & MediaCCC 2021-03-19 10:14:43 +01:00
TiA4f8R e55284bb8f
Code style improvements
Use final where possible in YoutubeStreamExtractor and do some other code style improvements
2021-03-05 16:38:53 +01:00
TobiGr d0a1041afd
Prevent NullPointerException and use equalsIgnorecase 2021-03-05 16:38:52 +01:00
TiA4f8R 890cbba625
Update PaidContent exception 2021-03-05 16:38:51 +01:00
TobiGr da3cfa967d
Handle age-restricted videos 2021-03-05 16:38:50 +01:00
TiA4f8R 448b68700c
Use final in exceptions and add AgeRestrictedException
AgeRestrictedException will be thrown only if the reason message equals to "Sign in to confirm your age" and if the age limit is 18.
2021-03-05 16:38:49 +01:00
TiA4f8R 59d6d3f04e
Fix YouTube tests 2021-03-05 16:38:42 +01:00
TiA4f8R 771bb1a2cb
Add three new exceptions for unavailable YouTube contents
These exceptions are thrown on a test with the error messages text, because YouTube returns only "UNPLAYABLE" status in most error cases.
Tests are based with English strings, so changing the lang used by
extractor will throw the generic exception (ContentNotAvailableException).
2021-03-05 16:38:39 +01:00
FireMasterK 5333d8a98b
Add more data. 2021-02-19 00:55:03 +05:30
bopol 1a322ad8ed Add uploader verified by service extraction 2021-02-18 16:36:40 +01:00
FireMasterK 5b70645d85 Add data to muxed streams aswell. 2021-02-18 20:16:53 +05:30
FireMasterK f31b2a68fd use getters/setters. 2021-02-18 20:16:53 +05:30
FireMasterK a7c9905183 Fix requested changes. 2021-02-18 20:16:52 +05:30
FireMasterK d1054338d3 Fix error with livestreams. 2021-02-18 20:16:52 +05:30
FireMasterK 11eb4932f4 Add data to respective classes. 2021-02-18 20:16:52 +05:30
FireMasterK e844d2aed3 Add dash fields to the ItagItem. 2021-02-18 20:16:52 +05:30
bopol 557934cb17 use EMPTY_STRING 2021-02-15 18:51:46 +01:00
bopol a931e31239 fix tests 2021-02-12 22:36:18 +01:00
TiA4f8R 1414a6f178
Fix extraction of YouTube chapters (#531)
YouTube changed the name of the chapters in the JSON from engagement-panel-macro-markers to engagement-panel-macro-markers-description-chapters, so extracting chapters doesn't work.
2021-02-03 22:07:34 +01:00
vkay94 11dcfe638b Add durationPerFrame to Frameset and getFrameBoundsAt method 2021-01-14 20:01:06 +01:00
TiA4f8R d30caeb091
Fix YouTube player JavaScript URL redirection 2020-12-27 15:55:03 +01:00
TobiGr bc6de14952 Extract stream and search meta info for YouTube
Add method to extract Google webcache URLs.
2020-12-22 18:19:26 +01:00
Tobias Groza 22a415156f
Merge pull request #479 from vkay94/stream-segments
Extract stream segments for YouTube
2020-12-19 11:12:22 +01:00
vkay94 2ba27b39af Stream segments: Remove replaceAll from setPreviewUrl 2020-12-12 15:00:45 +01:00
vkay94 d3eea4f4be Add stream segments to StreamInfo 2020-12-12 10:24:29 +01:00
Isira Seneviratne 4c19a88612 Use Objects.toString(). 2020-12-11 06:09:50 +05:30
Stypox 89a77ae74a
[YouTube] Fix detection of ended livestreams and parse livestream upload date 2020-11-04 16:03:08 +01:00
Stypox 827f7bd137
[YouTube] Cache deobfuscation and improve requests made
Fix age restriction extraction
Automatically fixes more things
2020-11-04 16:02:12 +01:00
Isira Seneviratne 4f04cfccca Switch from Calendar to OffsetDateTime in DateWrapper. 2020-11-01 06:28:54 +05:30
Stypox 30ed4f2d63
Remove any reference to decrypt and improve error message 2020-10-28 20:26:00 +01:00
TobiGr 62912ee834 Merge branch 'master' into dev 2020-10-28 14:28:06 +01:00
bopol 6dc5ab4015 find playerUrl in another place when assetsPattern regex fails 2020-10-27 13:48:58 +01:00
bopol db0ef83d6b fix youtube decryption and three attemps bug
fixes teamnewpipe/newpipe#4572 fixes #439
2020-10-27 13:40:24 +01:00
bopol 01f49e8f66 polish strings 2020-10-26 16:32:39 +01:00
Stypox 57e7994c9e
Add some missing finals, nullables and comments 2020-10-25 08:12:41 +01:00
Stypox 68d23defba
[YouTube] Do not catch every exception on getErrorMessage
@B0pol suggestion
2020-10-24 18:39:55 +02:00
Stypox 3191bd6c70
[YouTube] Use final when possible 2020-10-24 18:39:55 +02:00
Stypox 3b2cfb4ca2
[SoundCloud] Return empty video stream list instead of null
Also replace every instance of `return new ArrayList<>();` with `return Collections.emptyList();`
2020-10-24 18:23:46 +02:00
Stypox 072bae321f
[YouTube] Fix frame extraction for livestreams
Use saved playerResponse instead of parsing json every time
2020-10-24 18:23:46 +02:00
Stypox 7cd410f3fc
[YouTube] Return 0 when there is no timestamp, not -2, as per javadoc 2020-10-24 18:23:45 +02:00
Stypox 7fb867c166
[YouTube] Fix error message obtaining when there is none 2020-10-24 18:22:44 +02:00
Stypox 19e862657a
[YouTube] Fix some decryption exceptions by retrying 2020-10-15 20:16:44 +02:00
wb9688 ebbfe7f6d4 Skip YouTube's OTF streams 2020-09-29 10:48:02 +02:00
wb9688 7657c2ed1a Use initSafeStandardsObjects() 2020-08-15 17:08:07 +02:00
TobiGr 5ac80624a4 Fix detection of YouTube's decryption function
Closes TeamNewPipe/NewPipe#3951
2020-07-28 01:01:10 +02:00
Tobias Groza 32dff1541f
Merge pull request #370 from wb9688/fix-yt-age-restricted
Fix age restricted YouTube videos
2020-07-26 14:17:19 +02:00
TobiGr ec778200d9 Add comments to the code 2020-07-26 14:15:13 +02:00
wb9688 81459e289f Fix age restricted YouTube videos 2020-07-18 19:52:54 +02:00
wb9688 ff560e907a Remove getNextStream() from StreamExtractor 2020-07-15 18:48:37 +02:00
wb9688 156a26b64b Support start= timestamps for YouTube 2020-07-06 14:08:40 +02:00
wb9688 98055a3c3c Revert "Add more decryption function regexes"
This reverts commit 384d6acd5d.
2020-05-29 18:41:40 +02:00
Tobias Groza cf18cdb2f5
Merge pull request #329 from wb9688/decryption-regexes
Add more decryption function regexes
2020-05-29 10:10:50 +02:00
wb9688 384d6acd5d Add more decryption function regexes 2020-05-28 11:40:38 +02:00
wb9688 7ef3e80493 Extract dashManifestUrl in playerResponse 2020-05-15 12:07:26 +02:00
bopol de26e00079 changed all == null || isEmpty() to isNullOrEmpty() 2020-05-11 11:40:24 +02:00
wb9688 1de0876fb4 Fix #327 2020-05-09 20:06:50 +02:00
Roy Yosef a408661771 Fix PR review
Rename "ParentChannel" to "SubChannel"
Add Tests for sub-channel info fetching
2020-05-07 20:20:12 +02:00
Roy Yosef 1de1f97cf1 Add parent channel info to StreamExtractor: name, url & avatar url 2020-05-07 20:20:12 +02:00
bopol bc13e0c616 Merge remote-tracking branch 'upstream/dev' into soundcloudComments 2020-05-05 14:49:21 +02:00
wb9688 a1eabc7589 Return null instead of "" in getTextFromObject() 2020-05-02 08:02:25 +02:00
wb9688 b51699a20e Implement @TobiGr's suggestions 2020-04-20 14:27:33 +02:00
wb9688 979c5a7502 Use our fork of nanojson 2020-04-17 19:36:42 +02:00
bopol 636c430743 refactor: create extractors and linkHandler packages for SoundCloud, move YoutubeParsingHelper to youtube package (not linkhandler anymore) 2020-04-10 10:51:05 +02:00
Tobias Groza 8a9ae32e6b
Merge pull request #292 from wb9688/fix-yt-no-views
Fix YouTube videos with no views
2020-03-24 20:27:08 +01:00
Tobias Groza 6fd9b38ad9
Merge pull request #287 from mauriciocolli/fix-channel-redirect
[YouTube] Fix channel with redirects directly in the response
2020-03-23 18:41:56 +01:00
wb9688 904c9d681f Fix YouTube videos with no views 2020-03-18 10:07:49 +01:00
Stypox 325a51f73a
[YouTube] Do not crash if there is no next stream, but return null
Like every other extractor does if there is no next stream
2020-03-14 14:02:48 +01:00
Mauricio Colli 00d1ed439b
[YouTube] Fix channel extraction when redirects are in the response
Some redirects were embed directly into the response as instructions
for the page, instead of the usual http redirects.
2020-03-14 02:39:48 -03:00
Mauricio Colli cfc278317d
[YouTube] Fail-fast if status exist and is anything other than "OK" 2020-03-01 10:29:29 -03:00
Mauricio Colli 5686a6f562 [YouTube] Detect when a stream is deleted or doesn't exist
Added a test case as well.
2020-03-01 12:49:13 +01:00
Mauricio Colli 408f042127 [YouTube] Fix bug when url isn't present in the browseEndpoint object 2020-03-01 12:49:13 +01:00
wb9688 bfe3eb1409 Use suggested try-if code style 2020-02-29 17:18:50 +01:00
wb9688 45df8248bf Use Localization in getJsonResponse() 2020-02-29 16:55:07 +01:00
wb9688 157055fbfd Create getJsonResponse() function 2020-02-29 16:42:04 +01:00
wb9688 4f406512c2 Use YoutubeChannelLinkHandlerFactory 2020-02-29 16:26:28 +01:00
wb9688 4ff655352d Reimplement getAgeLimit() 2020-02-28 17:14:26 +01:00
wb9688 8bfbae904d Cache getVideo(Primary|Secondary)InfoRenderer() 2020-02-28 17:03:21 +01:00
wb9688 0b940f5cf4 Use "getAgeLimit() != NO_AGE_LIMIT" instead of "getAgeLimit() == 18" 2020-02-28 16:40:50 +01:00
wb9688 7898ba230d Use pbj in YoutubeStreamExtractor 2020-02-28 15:17:47 +01:00
wb9688 612ec06839 Actually fix thumbnail URLs starting with // 2020-02-28 09:36:33 +01:00
wb9688 94a2d5be46 Fix thumbnail URLs starting with // 2020-02-27 19:08:46 +01:00
wb9688 365b0329f3 Implement getTextFromObject() function 2020-02-27 17:39:23 +01:00
wb9688 8ebd971648 Fix channel descriptions consisting of multiple parts 2020-02-27 10:06:35 +01:00
wb9688 880b951088 Fix getUploaderAvatarUrl() in YoutubeStreamExtractor 2020-02-27 09:53:59 +01:00
wb9688 8aa560bef4 Fix video titles consisting of multiple parts due to @ 2020-02-27 09:42:22 +01:00
wb9688 a2d8489e16 Parse timestamps in description 2020-02-26 20:27:30 +01:00
wb9688 8d503407ef Parse browseEndpoint and watchEndpoint in descriptions 2020-02-26 19:37:58 +01:00
wb9688 88282761f4 Fix YoutubeStreamExtractor not being able to getAgeLimit() in onFetchPage() 2020-02-26 16:19:42 +01:00
wb9688 1c3a4e710b Check if there are no related streams in getAgeLimit() 2020-02-26 16:03:06 +01:00
TobiGr fc465c8bf7 Fix getUploadDate() for premiered videos with a given date
Detect publishDate and uploadDate
2020-02-25 22:54:37 +01:00
TobiGr 96285e0815 Fix getUploadDate() for premiered videos with a given date 2020-02-25 21:51:30 +01:00
wb9688 5a35300a5e Fix parsing upload date for premiered streams 2020-02-25 21:51:30 +01:00
wb9688 729fd2eaee Fix parsing description for navigationEndpoint without urlEndpoint 2020-02-25 21:51:30 +01:00
wb9688 26fb44595f Fix parsing description 2020-02-25 21:51:30 +01:00
TobiGr 0fff03038e Get description with correct links 2020-02-25 21:51:30 +01:00
wb9688 5d08c34322 Fix parsing upload date in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 bbe1a3cd62 Use getVideo(Primary|Secondary)InfoRenderer() 2020-02-25 21:51:30 +01:00
TobiGr ecfc27a92c Implement fallback methods for getDescription() and getTextualUploadDate() in YouTubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 eed29ea734 Return null for related streams at age restricted videos 2020-02-25 21:51:30 +01:00
TobiGr f39603f6ef Implement getUploadDate() in YouTubeStreamInfoItemExtractor 2020-02-25 21:51:30 +01:00
wb9688 26ea3dceb6 Fix getViewCount() in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 76d54abdbf Reimplement more methods in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 f13c0288cc Reimplement some methods in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 02b59903fa Remove useless code 2020-02-25 21:51:30 +01:00
wb9688 4039409820 Fix getLikeCount() for certain streams 2020-02-25 21:51:30 +01:00
TobiGr 5816202cc7 Move getInitialData() method to YouTubeParsingHelper
Rename ytInitialData to initialData
2020-02-25 21:51:30 +01:00
wb9688 b88188d419 Move stuff from extractVideoPreviewInfo() into YoutubeStreamInfoItemExtractor and partially fix search 2020-02-25 21:51:30 +01:00
wb9688 af49b3c487 Fix live streams in extractVideoPreviewInfo() 2020-02-25 21:51:30 +01:00
TobiGr 10e9c16d8c Fix LiveStream view count 2020-02-25 21:51:30 +01:00
wb9688 127c4d5893 Fix getNextStream() in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
wb9688 7bfc0e62c6 Fix getRelatedStreams() in YoutubeStreamExtractor 2020-02-25 21:51:30 +01:00
TobiGr 12166ca60c [StreamExtractor] Add fallback method for uploader avatar url 2020-02-25 21:51:30 +01:00
wb9688 3ec422a542 Fix like/dislike parsing 2020-02-25 21:51:30 +01:00
TobiGr 7dcc9f159b Stream: fix uploader avatar url 2020-02-25 21:51:30 +01:00
TobiGr 39bf1ff1eb Add ytInitialData regex 2020-02-25 21:51:30 +01:00
TobiGr 030465b5d4 Improve code formatting and optimise imports 2020-02-15 13:36:54 +01:00
bopol 70a40e7388 Description: rm constructor by serviceId 2020-02-07 13:28:27 +01:00
bopol 26c65b2948 Create class Description 2020-02-06 23:35:46 +01:00
B0pol b671a4ba18
Merge branch 'dev' into peertube 2020-02-01 18:18:23 +00:00
Mauricio Colli be81f2945c
[YouTube] Use correct upload date flag in StreamExtractor 2020-01-28 02:44:17 -03:00
TobiGr 033a9fb8e3 Revert change which I accidentally committed while fixing the decryption
function in 7b72fd2a7d
2020-01-25 21:08:17 +01:00
B0pol e392b6c68f getLanguageInfo returns Locale instead of String
so that java can automatically translate with Locale.getDisplayLanguage(), instead of always having English name of the language
2020-01-25 14:12:38 +01:00
B0pol b816e48216
Merge branch 'dev' into peertube 2020-01-24 20:10:47 +01:00
TobiGr f8d117f6cd Merge remote-tracking branch 'origin/master' into dev 2020-01-24 19:22:40 +01:00
TobiGr 7b72fd2a7d [YouTube] Add new decryption function 2020-01-24 02:10:56 +01:00
TobiGr bce87f3d01 Improve getDescriptionFuncName by removing catches and adding a loop 2020-01-24 02:10:38 +01:00
TobiGr 9b45c61103 Typos, comments and formatting 2020-01-24 02:10:18 +01:00
TobiGr 29a4cc78bf Fix typo in decryption constant 2020-01-24 02:10:08 +01:00
bopol 74439f692a add extraction for support info and rename getLanguageInfo function 2020-01-23 14:19:22 +01:00
B0pol bcfe7be4e6
Merge branch 'dev' into peertube 2020-01-22 19:19:41 +01:00
Stypox 1cfdc4547a
Update extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Co-Authored-By: Tobias Groza <TobiGr@users.noreply.github.com>
2020-01-20 22:52:48 +01:00
Stypox 1e1100ef76
Update extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java
Co-Authored-By: Tobias Groza <TobiGr@users.noreply.github.com>
2020-01-20 22:52:36 +01:00
bopol a281519e77 added metadata, fix descriptions, fix thumbnail, update tests
thumbnail: quality before: https://peertube.cpy.re/static/thumbnails/d2a5ec78-5f85-4090-8ec5-dc1102e022ea.jpg
quality after: https://peertube.cpy.re/static/previews/d2a5ec78-5f85-4090-8ec5-dc1102e022ea.jpg

description: we were getting about the first 260 characters, we now get full description (with fallback to first 260 chars if the get request for full description fails)
test: updated tests to match description, also changed some test: it was assertEquals(extracted, expected), but the proper way to do it is assertEquals(expected, extracted)

metadata: got host, privacy (public, private, unlisted), licence, language, tags
2020-01-20 12:22:33 +01:00
Stypox 1ed89aad3e
Use more often playerResponse in yt stream extractor
This enhances performance and should make the extractor more reliable since it get info from a stable json structure that shouldn't be subject to many changes. Fallback html methods have been kept. In case of error the thrown exception contains the data about the playerResponse failure, that should be clearer than a NPE caused by not-found html tags.
2020-01-06 20:45:57 +01:00
Tobias Groza d83787a5ca
Merge pull request #226 from 7FM/dev
fix switching on null causing NPE
2019-12-31 00:26:27 +01:00
Zsombor Gegesy 0a3422a591 Fix invalid jsoup query 2019-12-26 14:03:40 +01:00
7FM f57d9d43ce fix switching on null causing NPE 2019-12-21 14:15:42 +01:00
Mauricio Colli 3d21ef5dba
Introduce class that indicates when the time ago is an approximation 2019-11-03 15:46:28 -03:00
Mauricio Colli cb1e327a6e
[YouTube] Fix parsing of video reminders 2019-11-03 15:46:23 -03:00
Mauricio Colli d8280ce0da
[YouTube] Parse watching count in live streams items 2019-11-03 15:46:22 -03:00
Mauricio Colli 3638f0e0ea
Implement time ago parser and improve localization handling
- Handle special cases for languages where the number is not shown
- Rework the Downloader base implementation, allowing for more
advanced things to be done
- Separate the localization from the content country (just like
YouTube let's the user choose both).
2019-11-03 15:46:21 -03:00
wojcik-online 180836c180
Base Implementation: Parse the upload date of StreamInfoItems
In the format '2 days ago' (in English) on a YouTube channel page.
(Parser extensible to other pages.)
2019-11-03 15:46:20 -03:00
Mauricio Colli c4fe2183ce
[YouTube] Improve detection of reCAPTCHA pages 2019-10-29 02:00:41 -03:00
Mauricio Colli 9a325b280d
[YouTube] Make detection of age restricted pages more reliable 2019-10-29 02:00:40 -03:00
Mauricio Colli 91c360df5e
Remove section of dead code 2019-10-29 02:00:39 -03:00
Tobias Groza 06f2144e4d
[YouTube] Remove GEMA exception handling (#202) 2019-10-05 14:59:05 +02:00