Skip to content

Commit

Permalink
fix examples and increase version
Browse files Browse the repository at this point in the history
  • Loading branch information
shalva97 committed Dec 27, 2023
1 parent 3c5a94d commit 72720cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ repositories {
Add dependency:

```kotlin
implementation("com.github.shalva97:NewValve:1.0")
implementation("com.github.shalva97:NewValve:1.1")
```
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "io.github.shalva97"
version = "1.0"
version = "1.1"

repositories {
mavenCentral()
Expand Down
20 changes: 11 additions & 9 deletions src/jvmTest/kotlin/Examples.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import io.github.shalva97.initNewPipe
import org.schabi.newpipe.extractor.ServiceList
import org.schabi.newpipe.extractor.stream.StreamInfoItem
import kotlin.test.Test

class Examples {
Expand Down Expand Up @@ -30,17 +29,22 @@ class Examples {
initNewPipe()
val service = ServiceList.YouTube

val extractor =
val channelExtractor =
service.getChannelExtractor("https://www.youtube.com/channel/UC2H-gXCiXWfLdf9Be8pQ6Vg")
extractor.fetchPage()
channelExtractor.fetchPage()

println("Channel name: " + channelExtractor.name)
println("Subscribers: " + channelExtractor.subscriberCount)
println("-------------------------")

println("Channel name: " + extractor.name)
println("Channel name: " + extractor.subscriberCount)
val tabExtractor =
service.getChannelTabExtractorFromId("UC2H-gXCiXWfLdf9Be8pQ6Vg", "videos")
tabExtractor.fetchPage()

var currentPage = extractor.initialPage
var currentPage = tabExtractor.initialPage
var counter = 0

currentPage.items.forEach { it: StreamInfoItem ->
currentPage.items.forEach {
counter++
println("${it.url} - $counter - ${it.name}")
}
Expand All @@ -53,6 +57,4 @@ class Examples {
// }
// }
}


}

0 comments on commit 72720cb

Please sign in to comment.