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