Skip to content

extract_video_info.py bug fix #80

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions web-scraping/youtube-extractor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ To run this:
**Output:**
```
Title: Me at the zoo
Views: 172639597
Views: 218412790
Published at: 2005-04-23
Video Duration: 0:18
Video tags: me at the zoo, jawed karim, first youtube video
Likes: 8188077
Dislikes: 191986
Likes: 11084943
Dislikes: UNKNOWN

Description: The first video on YouTube. While you wait for Part 2, listen to this great song: https://www.youtube.com/watch?v=zj82_v2R6ts
Description: Watching Matt Koval's announcement about the removal of dislikes, I thought something was off.The spoken words did not match the eyes. The video reminded me ...


Channel Name: jawed
Channel URL: https://www.youtube.com/channel/UC4QobU6STFB0P71PMvOGN5A
Channel Subscribers: 1.98M subscribers
Channel Subscribers: 2.66 million subscribers
```
2 changes: 1 addition & 1 deletion web-scraping/youtube-extractor/extract_video_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def get_video_info(url):
channel_name = soup.find("span", itemprop="author").next.next['content']
# channel URL
# channel_url = soup.find("span", itemprop="author").next['href']
channel_url = f"https://www.youtube.com/{channel_tag}"
channel_url = f"https://www.youtube.com/channel/{channel_tag}"
# number of subscribers as str
channel_subscribers = videoSecondaryInfoRenderer['owner']['videoOwnerRenderer']['subscriberCountText']['accessibility']['accessibilityData']['label']
# channel details (old way)
Expand Down