Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
how to get the "comment_count" in the meta ? #12808
Comments
|
hi hi hi,this question has been troubled me for many days........ |
|
|
this is my code:
import youtube_dl
ydl_opts = {'forcetitle':'True','ignoreerrors':True,
'encoding':'utf-8','outtmpl':u'E:/Movie/%(title)s.%(ext)s'}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
meta = ydl.extract_info(
'https://www.youtube.com/watch?v=RGNTdUHN64Q', download=False)
print type(meta)
#print meta
print 'comment_count:',meta.get('comment_count','None')
[youtube] RGNTdUHN64Q: Downloading webpage
[youtube] RGNTdUHN64Q: Downloading video info webpage
[youtube] RGNTdUHN64Q: Extracting video information
WARNING: unable to extract uploader nickname
[youtube] RGNTdUHN64Q: Downloading MPD manifest
WARNING: "id" field is not a string - forcing string conversion
<type 'dict'>
comment_count: None
Process finished with exit code 0