2022-03-16 22:53:21 +01:00
|
|
|
plugins {
|
[YouTube] Workaround playlists' Shorts UI
YouTube doesn't return currently a continuation, if applicable, for
Shorts UI playlists, restricting access to the 100th first items. The
reel items returned don't give also upload date, uploader info and
precise view count.
Using a continuation which requests the first page of the playlist
allows currently to get access to continuations, if applicable, and
also standard video elements instead of Shorts ones, making extraction
of upload date, uploader info and precise view count again possible.
This method is used for all playlist types, the original request is
still made, but now only returns what we need.
It requires to add a protocol buffer definition file, for which its
structure is based on reverse engineering of playlists continuations
sent by WEB InnerTube client, received from InnerTube responses.
Java classes of this file are generated for the Java Lite runtime of
Protobuf with the Protobuf Gradle plugin, as the lite version is enough
for our use cases. This plugin ships in JARs Protobuf definitions,
which should be avoided.
As Protobuf classes are parsed by Checkstyle checks and do not follow
our style rules at all, an exclusion rule has been for them.
2025-04-18 15:27:44 +02:00
|
|
|
id "checkstyle"
|
|
|
|
id "com.google.protobuf" version "0.9.5"
|
2022-03-16 22:53:21 +01:00
|
|
|
}
|
|
|
|
|
2021-01-15 18:08:20 +01:00
|
|
|
test {
|
2022-03-16 22:53:21 +01:00
|
|
|
// Pass on downloader type to tests for different CI jobs. See DownloaderFactory.java and ci.yml
|
2021-01-15 18:08:20 +01:00
|
|
|
if (System.properties.containsKey('downloader')) {
|
|
|
|
systemProperty('downloader', System.getProperty('downloader'))
|
|
|
|
}
|
2021-12-27 21:08:08 +01:00
|
|
|
useJUnitPlatform()
|
2022-03-16 22:53:21 +01:00
|
|
|
dependsOn checkstyleMain // run checkstyle when testing
|
|
|
|
}
|
|
|
|
|
|
|
|
checkstyle {
|
|
|
|
getConfigDirectory().set(rootProject.file("checkstyle"))
|
|
|
|
ignoreFailures false
|
|
|
|
showViolations true
|
|
|
|
toolVersion checkstyleVersion
|
|
|
|
}
|
|
|
|
|
[YouTube] Workaround playlists' Shorts UI
YouTube doesn't return currently a continuation, if applicable, for
Shorts UI playlists, restricting access to the 100th first items. The
reel items returned don't give also upload date, uploader info and
precise view count.
Using a continuation which requests the first page of the playlist
allows currently to get access to continuations, if applicable, and
also standard video elements instead of Shorts ones, making extraction
of upload date, uploader info and precise view count again possible.
This method is used for all playlist types, the original request is
still made, but now only returns what we need.
It requires to add a protocol buffer definition file, for which its
structure is based on reverse engineering of playlists continuations
sent by WEB InnerTube client, received from InnerTube responses.
Java classes of this file are generated for the Java Lite runtime of
Protobuf with the Protobuf Gradle plugin, as the lite version is enough
for our use cases. This plugin ships in JARs Protobuf definitions,
which should be avoided.
As Protobuf classes are parsed by Checkstyle checks and do not follow
our style rules at all, an exclusion rule has been for them.
2025-04-18 15:27:44 +02:00
|
|
|
// Exclude Protobuf generated files from Checkstyle
|
|
|
|
checkstyleMain.exclude("org/schabi/newpipe/extractor/services/youtube/protos")
|
|
|
|
|
2022-03-16 22:53:21 +01:00
|
|
|
checkstyleTest {
|
|
|
|
enabled false // do not checkstyle test files
|
2021-01-15 18:08:20 +01:00
|
|
|
}
|
|
|
|
|
2025-03-05 16:20:50 +01:00
|
|
|
ext {
|
|
|
|
rhinoVersion = '1.8.0'
|
2025-07-17 09:51:21 +00:00
|
|
|
protobufVersion = '4.31.1'
|
2025-03-05 16:20:50 +01:00
|
|
|
}
|
|
|
|
|
2018-03-14 00:44:02 -03:00
|
|
|
dependencies {
|
|
|
|
implementation project(':timeago-parser')
|
|
|
|
|
2021-08-07 17:51:09 -04:00
|
|
|
implementation "com.github.TeamNewPipe:nanojson:$nanojsonVersion"
|
2025-07-07 21:00:47 +00:00
|
|
|
implementation 'org.jsoup:jsoup:1.21.1'
|
2025-02-15 14:23:33 +01:00
|
|
|
implementation "com.google.code.findbugs:jsr305:$jsr305Version"
|
[YouTube] Workaround playlists' Shorts UI
YouTube doesn't return currently a continuation, if applicable, for
Shorts UI playlists, restricting access to the 100th first items. The
reel items returned don't give also upload date, uploader info and
precise view count.
Using a continuation which requests the first page of the playlist
allows currently to get access to continuations, if applicable, and
also standard video elements instead of Shorts ones, making extraction
of upload date, uploader info and precise view count again possible.
This method is used for all playlist types, the original request is
still made, but now only returns what we need.
It requires to add a protocol buffer definition file, for which its
structure is based on reverse engineering of playlists continuations
sent by WEB InnerTube client, received from InnerTube responses.
Java classes of this file are generated for the Java Lite runtime of
Protobuf with the Protobuf Gradle plugin, as the lite version is enough
for our use cases. This plugin ships in JARs Protobuf definitions,
which should be avoided.
As Protobuf classes are parsed by Checkstyle checks and do not follow
our style rules at all, an exclusion rule has been for them.
2025-04-18 15:27:44 +02:00
|
|
|
implementation "com.google.protobuf:protobuf-javalite:$protobufVersion"
|
2018-03-14 00:44:02 -03:00
|
|
|
|
2025-03-05 16:20:50 +01:00
|
|
|
implementation "org.mozilla:rhino:$rhinoVersion"
|
|
|
|
implementation "org.mozilla:rhino-engine:$rhinoVersion"
|
2022-08-25 09:49:13 +02:00
|
|
|
|
2022-03-16 22:53:21 +01:00
|
|
|
checkstyle "com.puppycrawl.tools:checkstyle:$checkstyleVersion"
|
|
|
|
|
2021-12-27 21:08:08 +01:00
|
|
|
testImplementation platform("org.junit:junit-bom:$junitVersion")
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api'
|
2025-03-15 17:05:56 +01:00
|
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
2021-12-27 21:08:08 +01:00
|
|
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-params'
|
|
|
|
|
2025-02-11 20:46:45 +01:00
|
|
|
testImplementation "com.squareup.okhttp3:okhttp:4.12.0"
|
2025-07-07 21:00:04 +00:00
|
|
|
testImplementation 'com.google.code.gson:gson:2.13.1'
|
2020-04-16 16:08:14 +02:00
|
|
|
}
|
[YouTube] Workaround playlists' Shorts UI
YouTube doesn't return currently a continuation, if applicable, for
Shorts UI playlists, restricting access to the 100th first items. The
reel items returned don't give also upload date, uploader info and
precise view count.
Using a continuation which requests the first page of the playlist
allows currently to get access to continuations, if applicable, and
also standard video elements instead of Shorts ones, making extraction
of upload date, uploader info and precise view count again possible.
This method is used for all playlist types, the original request is
still made, but now only returns what we need.
It requires to add a protocol buffer definition file, for which its
structure is based on reverse engineering of playlists continuations
sent by WEB InnerTube client, received from InnerTube responses.
Java classes of this file are generated for the Java Lite runtime of
Protobuf with the Protobuf Gradle plugin, as the lite version is enough
for our use cases. This plugin ships in JARs Protobuf definitions,
which should be avoided.
As Protobuf classes are parsed by Checkstyle checks and do not follow
our style rules at all, an exclusion rule has been for them.
2025-04-18 15:27:44 +02:00
|
|
|
|
|
|
|
protobuf {
|
|
|
|
protoc {
|
|
|
|
artifact = "com.google.protobuf:protoc:$protobufVersion"
|
|
|
|
}
|
|
|
|
|
|
|
|
generateProtoTasks {
|
|
|
|
all().configureEach { task ->
|
|
|
|
task.builtins {
|
|
|
|
java {
|
|
|
|
option "lite"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|