https://github.com/dinaraparanid/ytdlp-kt
YtDlp wrapper for Kotlin
https://github.com/dinaraparanid/ytdlp-kt
kotlin youtube youtube-dl youtube-mp3-downloader yt-dlp yt-downloader yt-mp3 yt-music ytdlp
Last synced: 6 days ago
JSON representation
YtDlp wrapper for Kotlin
- Host: GitHub
- URL: https://github.com/dinaraparanid/ytdlp-kt
- Owner: dinaraparanid
- License: gpl-3.0
- Created: 2022-11-13T11:22:16.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T21:28:18.000Z (almost 3 years ago)
- Last Synced: 2024-11-30T04:20:27.446Z (11 months ago)
- Topics: kotlin, youtube, youtube-dl, youtube-mp3-downloader, yt-dlp, yt-downloader, yt-mp3, yt-music, ytdlp
- Language: Kotlin
- Homepage:
- Size: 138 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YtDlp-kt
[](https://jitpack.io/#dinaraparanid/YtDlp-kt)This library is a kotlin wrapper for [YtDlp](https://github.com/yt-dlp/yt-dlp) command line project.
### Setup
To integrate a library into your *build.gradle*:
1. Add the JitPack repository to your build file```groovy
allprojects {
repositories {
// ...
maven { url 'https://jitpack.io' }
}
}
```2. Add the dependency
```groovy
dependencies {
implementation 'com.github.dinaraparanid:YtDlp-kt:v1.0.0.0'
}
```For other configuration go [here](https://jitpack.io/#dinaraparanid/YtDlp-kt)
### Example
```kotlin
import com.dinaraparanid.ytdlp_kt.YtDlp
import com.dinaraparanid.ytdlp_kt.YtDlpRequestsuspend fun main() {
YtDlp.updateAsync().join() // or YtDlp.update()val videoUrl = "https://www.youtube.com/watch?v=K0HSD_i2DvA"
val request = YtDlpRequest(videoUrl).apply {
setOption("--audio-format", "mp3")
setOption("--socket-timeout", "1")
setOption("--retries", "infinite")
setOption("--extract-audio")
setOption("--format", "best")
}assert(YtDlp.execute(request) == YtDlp.executeAsync(request).await())
assert(YtDlp.getVideoData(videoUrl) == YtDlp.getVideoDataAsync(videoUrl).await())
}
```