Skip to content

Could not get n-parameter function #38

@Franknxtn

Description

@Franknxtn

I am using below implementation to retrieve VideoInfosWithDownloadFormatsResponse:

func getVideoDownloadFormats(videoID: String) async {
        let YTM = YouTubeModel()
        let dataParameters: [HeadersList.AddQueryInfo.ContentTypes : String] = [
            .query: videoID]
        do {
            let response = try await VideoInfosWithDownloadFormatsResponse.sendThrowingRequest(
                youtubeModel: YTM,
                data: dataParameters
            )
            
            for format in response.downloadFormats {
                print("URL: \(format.url?.absoluteString ?? "nil"), Quality: \(format.mimeType)")
            }
        } catch {
            print("❌ Failed to fetch formats: \(error)")
        }
    }

but it fails with below error:

❌ Failed to fetch formats: ResponseError(step: YouTubeKit.VideoInfosWithDownloadFormatsResponse.ResponseError.StepType.scrapPlayer, reason: "Could not get n-parameter function.")

Am i doing it right?

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