2022-08-27 15:13:24 +02:00

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
}