Code Monkey home page Code Monkey logo

Comments (7)

dpw1 avatar dpw1 commented on July 23, 2024

thank you for the kind words!

Currently, the only way I have found to get a youtube video's length is by accesing its value in the DOM via the .ytd-thumbnail-overlay-time-status-renderer selector and it takes a little bit to be loaded.

Do you think there are other ways to get this value before it is rendered to the DOM?

from youtube-filter.

Bengejd avatar Bengejd commented on July 23, 2024

Yeah, I actually linked you the network file path in my original comment

from youtube-filter.

dpw1 avatar dpw1 commented on July 23, 2024

Oops, sorry about that!

I confess I'm still not quite sure how to access that via Javascript though. Would you please give me some hint on this?

A bit off topic, I was able to find multiple objects at window starting with yt(something). Some of them may contain info about all the displayed videos!

from youtube-filter.

dpw1 avatar dpw1 commented on July 23, 2024

Found it!

window["ytInitialData"].contents.twoColumnSearchResultsRenderer.primaryContents.sectionListRenderer.contents[0].itemSectionRenderer.contents

This object contain accurate and instant information of all videos. That is amazing. I will play around with it.

Thank you!

from youtube-filter.

Bengejd avatar Bengejd commented on July 23, 2024

No problem! Glad I could help :)

from youtube-filter.

dpw1 avatar dpw1 commented on July 23, 2024

Hey @Bengejd , I hope you're doing well!

After a long time I decided to return to this project. I'm creating a new repository and starting from scratch with webpack.

Anyhow, I came across a situation and thought I'd ask if you have any ideas how I can move through this:

I managed to access the Youtube object with the data for timestamps. The issue is that it's huge and deeply nested. Here is an example.

I need to find a way to access all keys with the name of "videoRenderer" and add them to a single array of objects, but I'm stuck on this. Do you have any suggestions?

Thank you!

from youtube-filter.

dpw1 avatar dpw1 commented on July 23, 2024

Update: I found a solution after asking it on stackoverflow!

I'll keep you updated about the new version, it's much faster than the previous one.

from youtube-filter.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.