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

youtube search can not get video description #10198

Closed
6 of 9 tasks
kaixuangh opened this issue Jun 17, 2024 · 4 comments
Closed
6 of 9 tasks

youtube search can not get video description #10198

kaixuangh opened this issue Jun 17, 2024 · 4 comments
Labels
duplicate This issue or pull request already exists incomplete Further information is needed site-bug Issue with a specific website

Comments

@kaixuangh
Copy link

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Please make sure the question is worded well enough to be understood

def get_youtube_search(keyword, max_results=10):
ydl_opts = {
'quiet': True,
'skip_download': True,
'extract_flat': True,
'default_search': 'ytsearch',
'noplaylist': True, # 避免搜索结果返回整个播放列表
}

with YoutubeDL(ydl_opts) as ydl:
    # "ytsearch10:关键词" 将搜索与“关键词”相关的前10个视频
    search_keyword = f'ytsearch{max_results}:{keyword}'
    result = ydl.extract_info(search_keyword, download=False)
    return format_crawler_data(result)

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

No response

@kaixuangh kaixuangh added the question Question label Jun 17, 2024
@kaixuangh
Copy link
Author

kaixuangh commented Jun 17, 2024

description is None

@bashonly
Copy link
Member

please show complete verbose output (replace 'quiet': True with 'verbose': True in your ydl opts)

@bashonly bashonly added the incomplete Further information is needed label Jun 17, 2024
@seproDev
Copy link
Collaborator

seproDev commented Jun 17, 2024

The problem is that you use extract_flat. From the search playlist alone, we don't know the full description. If you always want the description, you need to let the video extract as well.

@bashonly
Copy link
Member

Duplicate of #6717

Youtube only returns partial descriptions with the search results (what you get with extract_flat). See #6717 (comment)

Related: #7445

@bashonly bashonly closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2024
@bashonly bashonly added duplicate This issue or pull request already exists site-bug Issue with a specific website and removed question Question labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists incomplete Further information is needed site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

3 participants