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

Commit

Permalink
Add Channel class
Browse files Browse the repository at this point in the history
  • Loading branch information
mytja committed Mar 19, 2022
1 parent 80a8280 commit 9efc396
Show file tree
Hide file tree
Showing 9 changed files with 789 additions and 3 deletions.
351 changes: 351 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2206,6 +2206,357 @@ print(transcript_2)
</details>


#### Retrieve channel info
```py
from youtubesearchpython import Channel

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

<details>
<summary> Example Result</summary>

```json
{
"id":"UC_aEa8K-EOJ3D6gOs7HcyNg",
"url":"https://www.youtube.com/channel/UC_aEa8K-EOJ3D6gOs7HcyNg",
"description":"NoCopyrightSounds is a copyright free / stream safe record label, providing free to use music to the content creator community. \n\nWe work with artists from around the world in electronic music, representing genres from House to Dubstep via Trap, Drum & Bass, Electro Pop and more. \n\nNCS Music is free to use for independent Creators and their UGC (User Generated Content) on YouTube & Twitch - always remember to credit the Artist, track and NCS and link back to our original NCS upload.\n\nView our usage policy and some frequently asked questions here: http://ncs.io/UsagePolicy\n\nGrab our new apparel range here: http://ncs.io/Store",
"title":"NoCopyrightSounds",
"banners":[
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w1060-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":1060,
"height":175
},
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w1138-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":1138,
"height":188
},
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w1707-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":1707,
"height":283
},
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w2120-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":2120,
"height":351
},
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w2276-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":2276,
"height":377
},
{
"url":"https://yt3.ggpht.com/ZdXDhvCVn73Shu-QkqWFoUS_TlZ9MSkAXb8VJBeI6ZKSN6oH4QBvTG2BCfuFRegjXwdp6qH3=w2560-fcrop64=1,00005a57ffffa5a8-k-c0xffffffff-no-nd-rj",
"width":2560,
"height":424
}
],
"subscribers":{
"simpleText":"32.1M subscribers",
"label":"32.1 million subscribers"
},
"thumbnails":[
{
"url":"https://yt3.ggpht.com/YIBi8NVC87fMfJHfQ2O0dyzjis7tUlO7VqWLhk1lq1fkIOQTrpX_Ip7G6S_u0IJosXYSe_Z9=s48-c-k-c0x00ffffff-no-rj",
"width":48,
"height":48
},
{
"url":"https://yt3.ggpht.com/YIBi8NVC87fMfJHfQ2O0dyzjis7tUlO7VqWLhk1lq1fkIOQTrpX_Ip7G6S_u0IJosXYSe_Z9=s88-c-k-c0x00ffffff-no-rj",
"width":88,
"height":88
},
{
"url":"https://yt3.ggpht.com/YIBi8NVC87fMfJHfQ2O0dyzjis7tUlO7VqWLhk1lq1fkIOQTrpX_Ip7G6S_u0IJosXYSe_Z9=s176-c-k-c0x00ffffff-no-rj",
"width":176,
"height":176
},
{
"url":"https://yt3.ggpht.com/YIBi8NVC87fMfJHfQ2O0dyzjis7tUlO7VqWLhk1lq1fkIOQTrpX_Ip7G6S_u0IJosXYSe_Z9=s900-c-k-c0x00ffffff-no-rj",
"width":900,
"height":900
},
{
"url":"https://yt3.ggpht.com/YIBi8NVC87fMfJHfQ2O0dyzjis7tUlO7VqWLhk1lq1fkIOQTrpX_Ip7G6S_u0IJosXYSe_Z9=s200-c-k-c0x00ffffff-no-rj?days_since_epoch=19070",
"width":200,
"height":200
}
],
"availableCountryCodes":[
"UZ",
"RS",
"HK",
"SZ",
"VE",
"NG",
"ID",
"MV",
"NU",
"ZW",
"BL",
"AQ",
"LU",
"MN",
"JM",
"KN",
"KZ",
"NR",
"RU",
"CM",
"BR",
"ML",
"HN",
"LS",
"BB",
"GM",
"AL",
"MS",
"SL",
"AO",
"NZ",
"TO",
"US",
"BJ",
"TN",
"VU",
"AF",
"GI",
"CY",
"HM",
"IR",
"FI",
"PR",
"TV",
"UA",
"NI",
"TW",
"KG",
"FM",
"LC",
"KH",
"IT",
"BW",
"CA",
"PA",
"SS",
"KW",
"SA",
"YT",
"RE",
"MW",
"GQ",
"BQ",
"GF",
"IQ",
"SB",
"FJ",
"ME",
"TH",
"TT",
"MR",
"AZ",
"GY",
"BT",
"SE",
"KE",
"LK",
"GS",
"TR",
"VG",
"DE",
"PK",
"BV",
"JP",
"MD",
"GA",
"UG",
"WF",
"CX",
"MF",
"SV",
"AW",
"CH",
"VI",
"TF",
"IO",
"EG",
"ES",
"CU",
"SY",
"MM",
"NP",
"JE",
"SC",
"VA",
"GW",
"YE",
"UY",
"LA",
"SK",
"SR",
"AI",
"PN",
"GP",
"PG",
"FO",
"EC",
"GL",
"OM",
"AS",
"MY",
"BI",
"AU",
"MH",
"BY",
"ZM",
"MQ",
"TM",
"SM",
"PH",
"NA",
"KP",
"CV",
"EH",
"KR",
"SI",
"SN",
"TC",
"BH",
"PF",
"PE",
"TG",
"MX",
"LY",
"MC",
"CD",
"LT",
"BS",
"SG",
"BZ",
"JO",
"KY",
"AD",
"CO",
"LR",
"SX",
"DO",
"CC",
"SJ",
"MP",
"ZA",
"HT",
"RO",
"ER",
"PL",
"GH",
"IL",
"ST",
"DJ",
"TD",
"FR",
"BD",
"BO",
"BN",
"MK",
"CI",
"BM",
"KM",
"NL",
"GD",
"CK",
"HR",
"PS",
"SD",
"TZ",
"GU",
"IN",
"LI",
"PY",
"TJ",
"PM",
"BA",
"SH",
"NO",
"EE",
"MT",
"BE",
"LB",
"DZ",
"AT",
"BG",
"GR",
"NF",
"DK",
"IM",
"RW",
"SO",
"TL",
"GN",
"MZ",
"CN",
"NC",
"LV",
"NE",
"VN",
"CZ",
"WS",
"CR",
"VC",
"CW",
"AG",
"CF",
"MA",
"FK",
"CL",
"MO",
"BF",
"IE",
"AX",
"MG",
"UM",
"KI",
"GG",
"AE",
"TK",
"PW",
"CG",
"GT",
"IS",
"MU",
"PT",
"QA",
"AR",
"GB",
"DM",
"ET",
"AM",
"GE",
"HU"
],
"isFamilySafe":true,
"keywords":"NoCopyrightSounds ncs no copyright sounds copyrighted music free royalty royaltyfree uncopyrighted copyrightfree",
"tags":[
"NoCopyrightSounds",
"ncs",
"no",
"copyright",
"sounds",
"copyrighted",
"music",
"free",
"royalty",
"royaltyfree",
"uncopyrighted",
"copyrightfree"
]
}
```
</details>


## Contributors
Thanks to everyone contributing to this library, including those not mentioned here.

Expand Down
5 changes: 4 additions & 1 deletion asyncExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ async def main():

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)
Expand All @@ -230,6 +230,9 @@ async def main():
print(transcript_2)


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




'''
Expand Down
3 changes: 3 additions & 0 deletions syncExample.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@
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 9efc396

Please sign in to comment.