nhCoder / YouTubeExtractor

Extracts Youtube urls for streaming and downloading purpose.
Apache License 2.0
68 stars 25 forks source link

i like this repo but i need to extract audio link from youtube #4

Closed waqarr closed 4 years ago

waqarr commented 5 years ago

i like this repo but i need to extract audio link from youtube

waqarr commented 5 years ago

how can i extract m4a audio link ?

nhCoder commented 5 years ago

@waqarr Use this code under onExtractionDone .

for(YoutubeMedia media:adativeStream){
                                                       if(media.isAudioOnly()){
                                                           ....
                                                       }
                                                   }

Sent from my HOT 4 PRO using FastHub

xibr commented 5 years ago

if i want show all Resolution how can i do that?

like this

for(YoutubeMedia media:muxedStream){ if(!media.isAudioOnly() && !media.isVideoOnly()) { addButtonToMainLayout(media.getResolution(), media.getUrl(), meta.getTitle()); } }

this return null media.getResolution()

nhCoder commented 5 years ago

@bunaif isVideoOnly is enough..

Sent from my HOT 4 PRO using FastHub

nhCoder commented 5 years ago

@bunaif As far as media.getResolution() it works only with videos.. It will return null for audios

Sent from my HOT 4 PRO using FastHub

xibr commented 5 years ago

@naveedhassan913 I know, but still give me a null.

Can you check them?

nhCoder commented 5 years ago

Actually I'm too busy these days, So there is less possibilities that i update the lib.Why don't unit fork lib and fix these issues yourself.

xibr commented 5 years ago

okay, I will try. Thank you

xibr commented 5 years ago

@naveedhassan913 fixed, now return hd720 or medium https://github.com/bunaif/YouTubeExtractor/commit/e66d48241ac944c6657b55d9f186c10a5a9080f5

check it. Screenshot_20190805-221801_

nhCoder commented 4 years ago

Lib updated... Use getMimeType() to differ audio /video