Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is this possible to fetch/extract youtube video tags? #393

Closed
waqarr opened this issue Aug 21, 2020 · 5 comments · Fixed by #306
Closed

is this possible to fetch/extract youtube video tags? #393

waqarr opened this issue Aug 21, 2020 · 5 comments · Fixed by #306
Labels
question Not really an issue, but more of a question about how something works youtube service, https://www.youtube.com/

Comments

@waqarr
Copy link

waqarr commented Aug 21, 2020

is this possible to fetch/extract youtube video tags with new pipe extractor?

@wb9688
Copy link
Contributor

wb9688 commented Aug 21, 2020

What exactly do you mean with "video tags"?

@waqarr
Copy link
Author

waqarr commented Aug 21, 2020

every video on youtube has tags (keywords) that help to rank the video. that tags/keywords i want to extract. i already extract with invidious api but is this possible that tags/keywords extract with newpipe extractor. its with video detail.

@wb9688
Copy link
Contributor

wb9688 commented Aug 21, 2020

You mean those things with a #? If so, iirc support for extracting those will be added by #306

@waqarr
Copy link
Author

waqarr commented Aug 21, 2020

these are not # hastags these are tags in every video user/uploader give that tags . kindly visit this api link

https://invidio.us/api/v1/videos/ZZhm8MJx1gA

you'll find in json "keywords" array

"keywords": [
"DIY",
"craft",
"crafts",
"prank",
"pranks",
"challenge",
"challenges",
"fun",
"funny",
"123GO!",
"123 go",
"123go",
"friends",
"friendly",
"tutorial",
"howto",
"how to"

change video id at the end of link and check every video has tags/keywords. is this possible to extract that keywords with new pipe extractor ?

@waqarr
Copy link
Author

waqarr commented Aug 23, 2020

I'm trying to fetch keywords but failed

` try {
NewPipe.init(DownloaderImpl.getInstance());
sExtractor = (YoutubeStreamExtractor) YouTube
.getStreamExtractor("https://www.youtube.com/watch?v=ZTBwxy4wsBQ").getTags();
sExtractor.fetchPage();

        JsonArray tagsArray = playerResponse.getObject("videoDetails").getArray("keywords");

        List<String> tagsList = new ArrayList<>();
        for (Object tag : tagsArray) {
            System.out.println(tag.toString());
        }



        Log.d("keywords", sExtractor.getTags().size()+"\n");
        for (String tags: sExtractor.getTags()
             ) {
            Log.d("keywords", tags+"\n");
        }
    } catch (ExtractionException | IOException e) {
        Log.d("keywordException", e.getMessage()+"");
    }`

In YoutubeStreamExtractor.java file

@Nonnull @Override public List<String> getTags() { return new ArrayList<>(); }

how can i get keywords of video

get this error message

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.grack.nanojson.JsonObject com.grack.nanojson.JsonObject.getObject(java.lang.String)' on a null object reference

@B0pol B0pol added question Not really an issue, but more of a question about how something works youtube service, https://www.youtube.com/ labels Dec 16, 2020
@B0pol B0pol linked a pull request Jan 24, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Not really an issue, but more of a question about how something works youtube service, https://www.youtube.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants