Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #165 from alexmercerind/transcript
Browse files Browse the repository at this point in the history
Add Transcript & Channel class
  • Loading branch information
mytja authored Mar 20, 2022
2 parents 823dc35 + 9efc396 commit 23e5dcf
Show file tree
Hide file tree
Showing 10 changed files with 1,126 additions and 3 deletions.
444 changes: 443 additions & 1 deletion README.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions asyncExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,21 @@ async def main():
print("Found all comments")



print(await Transcript.get("https://www.youtube.com/watch?v=L7kF4MXXCoA"))


url = "https://www.youtube.com/watch?v=-1xu0IP35FI"

transcript_en = await Transcript.get(url)
# you actually don't have to pass a valid URL in following Transcript call. You can input an empty string, but I do recommend still inputing a valid URL.
transcript_2 = await Transcript.get(url, transcript_en["languages"][-1]["params"]) # in my case, it'd output Spanish.
print(transcript_2)


print(await Channel.get("UC_aEa8K-EOJ3D6gOs7HcyNg"))




'''
Expand Down
16 changes: 16 additions & 0 deletions syncExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@
print("Found all comments")



print(Transcript.get("https://www.youtube.com/watch?v=L7kF4MXXCoA"))


url = "https://www.youtube.com/watch?v=-1xu0IP35FI"

transcript_en = Transcript.get(url)
# you actually don't have to pass a valid URL in following Transcript call. You can input an empty string, but I do recommend still inputing a valid URL.
transcript_2 = Transcript.get(url, transcript_en["languages"][-1]["params"]) # in my case, it'd output Spanish.
print(transcript_2)


print(Channel.get("UC_aEa8K-EOJ3D6gOs7HcyNg"))



'''
You may add/omit the optional parameters according to your requirement & use case.
'''
Expand Down
Loading

0 comments on commit 23e5dcf

Please sign in to comment.