Skip to content

Commit

Permalink
allChannels.py: Bump up to channel v2 api
Browse files Browse the repository at this point in the history
* Set Maximum limit of channels to 1000
  • Loading branch information
Mannu-1 authored and Shra1V32 committed Jan 19, 2022
1 parent 14433c3 commit 1132ea6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions code_samples/allChannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@


def getChannelInfo(channelId):
url = "{}content-detail/pub/api/v1/channels/{}".format(API_BASE_URL, channelId)
url = "{}content-detail/pub/api/v2/channels/{}".format(API_BASE_URL, channelId)
x = requests.get(url)
channel_meta = x.json()['data']['meta'][0]
meta_data= x.json()['data']['meta']
channel_meta = x.json()['data']['channelMeta']
channel_detail_dict = x.json()['data']['detail']
onechannl = {
"channel_id": str(channelId),
Expand Down Expand Up @@ -41,7 +42,7 @@ def processChnuks(channel_lists):

def getAllChannels():
ts = []
url = API_BASE_URL + "content-detail/pub/api/v1/channels?limit=534"
url = API_BASE_URL + "content-detail/pub/api/v1/channels?limit=1000"
x = requests.get(url)
channel_list = x.json()['data']['list']
print("Total Channels fetched:", len(channel_list))
Expand Down

0 comments on commit 1132ea6

Please sign in to comment.