Download videos from google search #24936

Open
opened 2026-02-21 12:16:44 -05:00 by deekerman · 10 comments
Owner

Originally created by @gonprats on GitHub (Jan 30, 2022).

Checklist

  • I'm reporting a site feature request
  • I've verified that I'm running youtube-dl version 2021.12.17
  • I've searched the bugtracker for similar site feature requests including closed ones

Description

With the latest google search versions, one can look up "NFL" (for example), and the schedules, players and teams pop-up as well as (and this is what I'm suggesting to implement) previews or highlights. When trying to download them from the Google page, it does not recognizes it, the user needs to get into the actual video (youtube in most cases) to get it. Implementing this would mean much faster access to videos and the users not having to navigate several layers of webpages to download them.
I tried creating a general "google extractor" but couldn't manage to do it. Other option I thought about but could not put into practice was to handle that webpage forwarding (google search -> youtube) within the program

Originally created by @gonprats on GitHub (Jan 30, 2022). <!-- ###################################################################### WARNING! IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE ###################################################################### --> ## Checklist <!-- Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl: - First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.12.17. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED. - Search the bugtracker for similar site feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates. - Finally, put x into all relevant boxes (like this [x]) --> - [x] I'm reporting a site feature request - [x] I've verified that I'm running youtube-dl version **2021.12.17** - [x] I've searched the bugtracker for similar site feature requests including closed ones ## Description <!-- Provide an explanation of your site feature request in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible. --> With the latest google search versions, one can look up "NFL" (for example), and the schedules, players and teams pop-up as well as (and this is what I'm suggesting to implement) previews or highlights. When trying to download them from the Google page, it does not recognizes it, the user needs to get into the actual video (youtube in most cases) to get it. Implementing this would mean much faster access to videos and the users not having to navigate several layers of webpages to download them. I tried creating a general "google extractor" but couldn't manage to do it. Other option I thought about but could not put into practice was to handle that webpage forwarding (google search -> youtube) within the program
Author
Owner

@dirkf commented on GitHub (Jan 30, 2022):

You'll need to open the search page with JS disabled to see anything like what yt-dl would see. With any luck, the video page will be the value of a parameter, eg q, in the link in the search page.

Some examples of search pages, video links in the pages and the linked videos could help this along.

@dirkf commented on GitHub (Jan 30, 2022): You'll need to open the search page with JS disabled to see anything like what yt-dl would see. With any luck, the video page will be the value of a parameter, eg `q`, in the link in the search page. Some examples of search pages, video links in the pages and the linked videos could help this along.
Author
Owner

@pukkandan commented on GitHub (Jan 31, 2022):

There is already a google search extractor. It is broken atm, but easy to fix. See github.com/yt-dlp/yt-dlp@c533c89ce1

@pukkandan commented on GitHub (Jan 31, 2022): There is already a google search extractor. It is broken atm, but easy to fix. See https://github.com/yt-dlp/yt-dlp/commit/c533c89ce1d6965d8575413738d76a5bf9e2de59
Author
Owner

@dirkf commented on GitHub (Jul 14, 2022):

Thanks.

First see https://github.com/ytdl-org/youtube-dl/issues/29724 and the issue linked from it, and the manual, especially the section linked from there.

From the comment, possibly the linked fork has fixed the extractor and you will just need to back-port the change.

Once you have a branch working in your fork, you can make a Pull Request against the yt-dl repo.

@dirkf commented on GitHub (Jul 14, 2022): Thanks. First see https://github.com/ytdl-org/youtube-dl/issues/29724 and the issue linked from it, and the manual, especially the section linked from there. From the [comment](https://github.com/ytdl-org/youtube-dl/issues/30576#issuecomment-1026427016), possibly the linked fork has fixed the extractor and you will just need to back-port the change. Once you have a branch working in your fork, you can make a Pull Request against the yt-dl repo.
Author
Owner

@Mamadou442 commented on GitHub (Jul 16, 2022):

how do i back-port the change ? I just search what it mean, should it mean that i should Copy paste the commit and make the PR myself ?

@Mamadou442 commented on GitHub (Jul 16, 2022): how do i back-port the change ? I just search what it mean, should it mean that i should Copy paste the commit and make the PR myself ?
Author
Owner

@Mamadou442 commented on GitHub (Jul 16, 2022):

i make a fork myself so I doing to work like that (use the commit of @pukkandan )

@Mamadou442 commented on GitHub (Jul 16, 2022): i make a fork myself so I doing to work like that (use the commit of @pukkandan )
Author
Owner

@dirkf commented on GitHub (Jul 16, 2022):

One way is to use a tool like meld, a graphical difference editor. Check out yt-dl and yt-dlp, load the yt-dlp extractor into the editor and load the yt-dl extractor into the right-hand pane. Then you can go through the differences and decide whether the yt-dlp change should applied directly, modified or ignored. Some changes will be specific to yt-dlp and need to be adapted so as to run on both Python 2 and 3. For example, the linked commit includes these lines that will fail in Python 2

                'http://www.google.com/search', f'gvsearch:{query}',
                note=f'Downloading result page {pagenum + 1}',

You'll need to change this in some way, say:

                'http://www.google.com/search', 'gvsearch:' + query,
                note='Downloading result page %d' % (pagenum + 1, ),

Some IDE plug-in or judicious use of vi and diff could achieve the same result.

If there is a specific change, a commit or set of commits, that should be applied, you can use git magic to apply such commits while preserving the commit details. In GH you can add .patch to commit and PR URLs to generate a patch file that you can pass to the git am command: to make the patch applicable you first have to edit it to replace the yt_dlp/ in pathnames with youtube_dl/. After applying the patch to your branch you can make any additional changes in your own subsequent commit. Eventually when this gets merged we would probably squash the commits in the PR so that the resulting commit appears as Co-authored by: all the people whose commits are included.

As above, test the modified extractor in your patch branch (there's a small test in the linked commit). Then push the branch to your yt-dl fork. You should be able to enable the server-side tests that ensure your changes work in a variety of supported environments. Fix any issues and then create a PR against our youtube_dl repo.

@dirkf commented on GitHub (Jul 16, 2022): One way is to use a tool like [_meld_](https://opensource.com/article/20/3/meld), a graphical difference editor. Check out yt-dl and yt-dlp, load the yt-dlp extractor into the editor and load the yt-dl extractor into the right-hand pane. Then you can go through the differences and decide whether the yt-dlp change should applied directly, modified or ignored. Some changes will be specific to yt-dlp and need to be adapted so as to run on both Python 2 and 3. For example, the linked commit includes these lines that will fail in Python 2 ``` 'http://www.google.com/search', f'gvsearch:{query}', note=f'Downloading result page {pagenum + 1}', ``` You'll need to change this in some way, say: ``` 'http://www.google.com/search', 'gvsearch:' + query, note='Downloading result page %d' % (pagenum + 1, ), ``` Some IDE plug-in or judicious use of _vi_ and _diff_ could achieve the same result. If there is a specific change, a commit or set of commits, that should be applied, you can use _git_ magic to apply such commits while preserving the commit details. In GH you can add `.patch` to commit and PR URLs to generate a patch file that you can pass to the `git am` command: to make the patch applicable you first have to edit it to replace the `yt_dlp/` in pathnames with `youtube_dl/`. After applying the patch to your branch you can make any additional changes in your own subsequent commit. Eventually when this gets merged we would probably `squash` the commits in the PR so that the resulting commit appears as `Co-authored by:` all the people whose commits are included. As above, test the modified extractor in your patch branch (there's a small test in the linked commit). Then push the branch to your yt-dl fork. You should be able to enable the server-side tests that ensure your changes work in a variety of supported environments. Fix any issues and then create a PR against our youtube_dl repo.
Author
Owner

@K-web04 commented on GitHub (Jan 23, 2023):

Hey,Can I work on this issue

@K-web04 commented on GitHub (Jan 23, 2023): Hey,Can I work on this issue
Author
Owner

@dirkf commented on GitHub (Jan 23, 2023):

Please do.

@dirkf commented on GitHub (Jan 23, 2023): Please do.
Author
Owner

@drashtiv03 commented on GitHub (Jun 29, 2025):

Can I work on this issue if no one's on it? @dirkf

@drashtiv03 commented on GitHub (Jun 29, 2025): Can I work on this issue if no one's on it? @dirkf
Author
Owner

@dirkf commented on GitHub (Jun 29, 2025):

Sure. Possibly the "AI"-ification of G search and/or the requirement to have JS for G search now makes this impractical. Let us know.

@dirkf commented on GitHub (Jun 29, 2025): Sure. Possibly the "AI"-ification of G search and/or the requirement to have JS for G search now makes this impractical. Let us know.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#24936
No description provided.