Get channel id from channel link #655
DinhHuy2010
started this conversation in
Ideas
Replies: 1 comment 6 replies
-
# https://stackoverflow.com/questions/46406866/get-channelid-from-youtube-custom-url
import requests
from bs4 import BeautifulSoup
def get_channel_id(channel_link):
resp = requests.get(channel_link)
soup = BeautifulSoup(resp.text, "html.parser")
channel_id = soup.select_one("meta[property=\"og:url\"]")["content"].strip("/").split("/")[-1]
return channel_id There was 0 reason to zip that code, that just looks suspicious doing that @DinhHuy2010 |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the code the get any channel id from channel link (if you have not done) (ZIP file)
get_channel_id.zip
EDIT: The code:
Beta Was this translation helpful? Give feedback.
All reactions