Skip to content

Calling YoutubeDL.extractInfo(url:) results in EXC_BAD_ACCESS #9

@3bnz

Description

@3bnz

Hello 👋

Thanks for maintaining these repositories!

I'm experiencing a crash, when trying to extract info from a video.
The following test is also failing with 🛑 EXC_BAD_ACCESS
The crash appears to be originating from FFmpeg-iOS-Support dependency.

Test

The following test has been crashing as well:

func testExtractInfo() async throws {
let youtubeDL = YoutubeDL()
let (formats, info) = try await youtubeDL.extractInfo(url: URL(string: "https://www.youtube.com/watch?v=WdFj7fUnmC0")!)
print(formats, info)
XCTAssertEqual(info.title, "YoutubeDL iOS app demo")
XCTAssertGreaterThan(formats.count, 0)
}

Workaround

Although I was not able to determine the cause of the crash,
I currently have a workaround for extracting info by making a direct call:

// ✅ Passing
func testDirectExtractInfo() async throws {
    let youtubeDL: PythonObject = try await YtDlp().yt_dlp.YoutubeDL(["nocheckcertificate": true])
    let info = try PythonDecoder()
        .decode(
            Info.self,
            from: youtubeDL
                .extract_info
                .throwing
                .dynamicallyCall(withKeywordArguments: ["": "WdFj7fUnmC0", "download": false])
        )
    XCTAssertEqual(info.title, "YoutubeDL iOS app demo")
}

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