Skip to content

downloader.getVideoInfo(request).data() return null data and response error:Transformation functions not found #148

@PeOS-China

Description

@PeOS-China

Hello, I used the response.data() method to get the youtube video information, but it returned nothing and I couldn't get the video playback URL or audio URL. And response error:Transformation functions not found
implementation 'com.github.sealedtx:java-youtube-downloader:3.2.8'

        var responseError: String? = null
        try {
            val request = RequestVideoInfo(videoId).clientType(ClientType.MWEB)
            val response: Response<VideoInfo> = downloader.getVideoInfo(request)
            responseError = response.error()?.localizedMessage
            val video: VideoInfo = response.data()
            val url = if(isVideo) {
                val videoFormats = video.videoFormats()
                if(videoFormats.isNotEmpty()) videoFormats.first().url()
                else ""
            } else {
                val audioFormats = video.audioFormats()
                if(audioFormats.isNotEmpty()) audioFormats.first().url()
                else ""
            }
            val details = video.details()
            val second = details.lengthSeconds()
            Log.d(tag, "JavaYT parse success($videoId)($second): $url")
            return Triple(url, second, null)
        } catch (e: Throwable) {
            Log.d(tag, "JavaYT parse fail($videoId):${e.localizedMessage}")
            Log.d(tag, "JavaYT parse fail($videoId) response error:${responseError}")
            return Triple("", 0, e)
        }

videoId -> rTfLtGlwCHE
AZnt-0fEiT0
DPtn9KzfsGI
OhW6t4rEJwU
or orher video id

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions