mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-09 02:50:30 +05:30
13 lines
285 B
Kotlin
13 lines
285 B
Kotlin
|
package com.github.libretube.util
|
||
|
|
||
|
/**
|
||
|
* 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
|
||
|
}
|