lithdew / youtube Goto Github PK
View Code? Open in Web Editor NEWA library for executing search queries, retrieving metadata, and obtaining direct links to video-only/audio-only/muxed versions of videos on YouTube in Go.
License: MIT License
A library for executing search queries, retrieving metadata, and obtaining direct links to video-only/audio-only/muxed versions of videos on YouTube in Go.
License: MIT License
panic: got malformed json searching for page 0 of query "animus vox": cannot parse JSON: cannot parse empty string; unparsed tail: ""
Any ideas?
Possible helpfull link https://github.com/streamlink/streamlink (python)
I'm trying to use this library to download audio for a given video. In my case, I already have the video ID as a string, and I am providing it to the Load() method directly: youtube.Load(videoID)
. A player gets returned, I can use it to get audio, and I can see the filename of each audio track. When I try to use player.ResolveURL()
to retrieve the full URL of the audio, it returns an error. I see the same result for every video that I try.
Here's an example code snippet that I've set up to demonstrate:
func getAudioFromVideo(string videoID) {
player, err := ydl.Load(videoID)
fmt.Println("Attempting to get audio for ID:", videoID)
if err != nil {
fmt.Println("Error with player:", err)
}
stream := player.SourceFormats().AudioOnly().SortByAudioQuality()
for i, s := range stream {
fmt.Println("")
fmt.Println("Attempting to get audio version", i+1, "of", len(stream))
fmt.Println(s)
audioOnlyFilename := "audio." + s.FileExtension()
fmt.Println("audioOnlyFilename:", audioOnlyFilename)
audioOnlyURL, err := player.ResolveURL(s)
if err != nil {
fmt.Println("Error on ResolveURL:", err)
}
fmt.Println(audioOnlyURL)
}
}
getAudioFromVideo("fhCTLEEkhYY")
please allow channel to return
Being used the code sample in readme, it doesnt work. Output:
panic: got malformed json searching for page 0 of query "animus vox": cannot parse JSON: cannot parse number: unexpected char: "\x00"; unparsed tail: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\" scrolling=\"no\"></iframe></body></html>"
Tried to run the example in the README file but got the following error:
panic: got malformed json searching for page 0 of query "animus vox": cannot parse JSON: cannot parse number: unexpected char: "\x00"; unparsed tail: "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...\" scrolling=\"no\"></iframe></body></html>"
a way to get a channels latest upload, channel stats etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.