mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-07 10:00:31 +05:30
12 lines
271 B
Kotlin
12 lines
271 B
Kotlin
package com.github.libretube.extensions
|
|
|
|
/**
|
|
* format a Piped route to an ID
|
|
*/
|
|
fun String.toID(): String {
|
|
return this
|
|
.replace("/watch?v=", "") // videos
|
|
.replace("/channel/", "") // channels
|
|
.replace("/playlist?list=", "") // playlists
|
|
}
|