• normalexit@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    3 days ago

    From the NewPipe FAQ:

    Does NewPipe use the YouTube API?

    No. NewPipe does not rely on the YouTube API, as using it requires an API key bringing with it specific regulations and restrictions. YouTube would then have more options of tracking your YouTube usage at their disposal. Therefore, NewPipe Extractor gets the information by parsing YouTube websites.

    • shrugal@lemmy.world
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      3 days ago

      So that would mean it should be counted the same as a visit from a regular user, no? Unless YT tries to detect and filter out NP visits specifically.

      • normalexit@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        edit-2
        3 days ago

        Using the API “correctly” is likely a requirement for the view to be counted. Their media extractor circumvents that by intentionally not using their API and instead parsing their website for content. Then it establishes a connection to the stream using an internal API.

        If you want a view to count you need to use an official client (or at least one with a legit API key). It not counting is a feature with NewPipe.

        (Google probably knows the content is being streamed, but if you could just create synthetic views with a third party project, that would be bad for YouTube stats)

        • rudyharrelson@lemmy.radio
          link
          fedilink
          arrow-up
          5
          ·
          edit-2
          3 days ago

          If you want a view to count you need to use an official client

          I would think that parsing the website would count the same as any browser-based page load, since parsing the website requires first fetching the page (probably using something like wget or curl under the hood). I dunno if non-logged-in page loads are generally counted toward the overall view count on a given video, though.

          • dan@upvote.au
            link
            fedilink
            arrow-up
            6
            ·
            3 days ago

            Page loads don’t count as a view though, because otherwise things like search engine indexing would count as a view. It’s only considered a view if the video is watched for at least 30 seconds.

            • shrugal@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              6 hours ago

              Search engines are easy to detect and filter out though, they have very distinct UA strings.

              • dan@upvote.au
                link
                fedilink
                arrow-up
                1
                ·
                6 hours ago

                That was just an example. There’s all sorts of automated traffic that shouldn’t count as a view. A human loading the page but not actually playing the video (like if they disable auto playing of videos) shouldn’t count as a view either.

          • normalexit@lemmy.world
            link
            fedilink
            arrow-up
            1
            ·
            3 days ago

            They parse the website for feeds, search, etc. It is a java library and it looks like they are using jsoup to parse the dom.

            Using the website and actually establishing a connection to a video are separate things. The search side of things is essentially a headless browser that is just aimlessly looking for videos. As far as YouTube is concerned nothing is played during this process.

            When you decide to commit and watch a video, the NewPipe client establishes a connection to the video stream, which doesn’t count for YouTube stats.

            YouTube counts a view for long-form content when a viewer watches for at least 30 seconds, while Shorts views count each time a short begins to play or replay, with no minimum watchtime. Valid views must come from human users, with limitations on how often the same person can generate views within a short timeframe to prevent fraud from bots or artificial inflation.

    • Daemon Silverstein@calckey.world
      link
      fedilink
      arrow-up
      1
      ·
      3 days ago

      @kionite231@lemmy.ca @NONE_dc@lemmy.world

      As far as I know, there are two different domains in play here: YouTube dot com, and Googlevideo dot com. The first serves the main interface, as well as the API endpoints. The latter serves the stream.

      Both deal with geographical distribution (CDN) so the domain solves (via DNS) to a data center as closest as possible to the user (e.g. if I access YouTube, the domains will solve to Google data centers in Sao Paulo).

      This regionalization makes it difficult for real-time communication of video statistics, so the view count and other information is often delayed as they’re aggregated geographically and later communicated back to their main data center.

      That’s also why, for example, a video Id isn’t sequential (1,2,3,4,…), because it’d require the servers to communicate their machine states in real-time, thus leading to the same (or worse) delays from users accessing the main data center directly, which can be as farther as dozens of thousands of kilometers from the user if the said user is in, say, the middle east, because the main servers are USian and light can go as fast as circa 300.000km/s in vacuum, getting slower if light needs to go through glass, which is the case for optic cables: even though it seems fast, it’s actually slow in computing terms because information needs to arrive and go multiple times in order to carry all the network packets.

      Then, there’s another phenomenon: a video streaming can involve multiple reconnections, as the content is being streamed. This is even noticeable when there are thousands or millions of simultaneous viewers, and the user notices this as buffering delays. If each connection were to count a new view, it’d count the same viewer multiple times, so the view count is done through the main interface instead, through the main domain YouTube dot com. Even when people access the video through the app or through a smart TV, the device will request the YouTube domain which will return information regarding the stream, such as the exact URL for the said video on Googlevideo.

      Invidious, as far as I know, uses the main interface to retrieve the streaming information (web scraping, as the official API is restricted in this regard), so it’s as if some user were accessing it, so it should count as a view. The new view count isn’t instantaneous so that’s probably why you didn’t see the viewer count going up.

  • dan@upvote.au
    link
    fedilink
    arrow-up
    4
    ·
    3 days ago

    YouTube only counts a view if it’s longer than 30 seconds, but clients like Newpipe don’t send the tracking data to Google for them to track this.