Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- import re
- import time
- import sys
- import base64
- import datetime
- import os
- from bs4 import BeautifulSoup as bs
- from itertools import chain, starmap
- import requests as beg
- from bs4 import BeautifulSoup as sidenie
- # NET_TO_COOKIE
- def net_to_cookie(filename, service):
- cookies = {}
- try:
- with open(filename, 'r', encoding='utf-8') as fp:
- for line in fp:
- try:
- if not re.match(r'^\#', line) and service in line:
- lineFields = line.strip().split('\t')
- cookies[lineFields[5]] = lineFields[6]
- except Exception as err:
- continue
- except UnicodeDecodeError:
- with open(filename, 'r') as fp:
- for line in fp:
- try:
- if not re.match(r'^\#', line) and service in line:
- lineFields = line.strip().split('\t')
- cookies[lineFields[5]] = lineFields[6]
- except Exception as err:
- continue
- return cookies
- def get_json_settings_from_file(file_name):
- try:
- settings_data = work_with_file(file_name, read_mode='read')
- settings_data = json.loads(settings_data)
- return settings_data
- except json.decoder.JSONDecodeError:
- print('не удалось считать файл settings.json\n' \
- 'просмотрите пример указаный в описании\n' \
- 'или же указана неправильная кодировка файла, необходимая кодировка utf-8')
- input()
- sys.exit()
- except Exception as e:
- print(f'ошибка {e} при загрузке файла settings.json')
- input()
- sys.exit()
- def get_json_data_from_file(data, key_, int_=False):
- try:
- if int_:
- return int(data[key_])
- else:
- return data[key_]
- except ValueError:
- print(f'ошибка при считывании числа c поля {key_}')
- input()
- sys.exit()
- except Exception as e:
- print(f'ошибка {e} при считывании поля {key_}')
- input()
- sys.exit()
- def work_with_file(file_name, mode='r', write_data=None, encoding='utf-8', read_mode='read'):
- with open(file_name, mode=mode, encoding=encoding) as f:
- if mode == 'w' or mode == 'a':
- f.write(write_data)
- elif mode == 'r':
- if read_mode == 'read':
- data = f.read()
- elif read_mode == 'readlines':
- data = [data.replace('\n', '') for data in f.readlines()]
- else:
- raise Exception(f'invalid read_mode {read_mode}')
- return data
- def all_accounts(cookies):
- r = requests.get('https://www.youtube.com/channel_switcher?next=%2Faccount&feature=settings', cookies=cookies)
- # with open("all_accounts.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- soup = bs(r.text, 'html.parser')
- res = []
- all_channel_urls = soup.find_all('div', attrs={'class':'highlight'})
- for i in all_channel_urls:
- res.append(i.find('a', attrs={'class':'yt-uix-button yt-uix-sessionlink yt-uix-button-default yt-uix-button-size-default'}).get('href'))
- return res
- # COOKIES_TO_HEADER
- def cookies_to_header(cookies, mode='dict'):
- levi = ''
- for key, value in cookies.items():
- levi += f'{key}={value}; '
- headers = {
- 'Cookie':levi[0:-1]
- }
- if mode == 'dict':
- return headers
- return levi
- # FORMAT_JSON
- def format_json(dictionary):
- """ Структурироване JSON данных для улучшения поиска """
- def unpack(parent_key, parent_value):
- """ Рекурсивное распаковывание JSON данных """
- if isinstance(parent_value, dict):
- for key, value in parent_value.items():
- temp1 = parent_key + '_' + key
- yield temp1, value
- elif isinstance(parent_value, list):
- i = 0
- for value in parent_value:
- temp2 = parent_key + '_' + str(i)
- i += 1
- yield temp2, value
- else:
- yield parent_key, parent_value
- while "True":
- dictionary = dict(chain.from_iterable(
- starmap(unpack, dictionary.items())))
- if not any(isinstance(value, dict) for value in dictionary.values()) and \
- not any(isinstance(value, list) for value in dictionary.values()):
- break
- return dictionary
- # GET_CHANNEL_ID
- def get_channel_id(session, my_cookies, headers):
- r = session.get('https://studio.youtube.com/', cookies = my_cookies, headers=headers)
- r = session.get('https://studio.youtube.com/channel/?approve_browser_access=1', cookies = my_cookies, headers=headers)
- # with open("get_channel_id.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- channelId = r.text.split('"channelId":"')[1].split('"')[0]
- ide = r.text.split('"DATASYNC_ID":"')[1].split('"')[0]
- api_key = r.text.split('"INNERTUBE_API_KEY":"')[1].split('"')[0]
- start = " window.chunkedPrefetchResolvers['id-0'].resolve("
- end = ");"
- try:
- html = r.text.split(start)[1].split(end)[0]
- json_data = json.loads(html)
- formatted_json_data = format_json(json_data)
- except Exception as e:
- return
- return formatted_json_data, channelId, ide, api_key
- def check_all_account(links, my_cookies):
- all_accs = ''
- dict2 = my_cookies
- accounts = {}
- counter = 1
- for i in links:
- session = requests.Session()
- # print(i) # links
- r = session.get(f"https://www.youtube.com{i}", cookies=dict2)
- dict3 = session.cookies.get_dict()
- dict2.update(dict3)
- resss = dict2
- headers = cookies_to_header(resss)
- try:
- formatted_json_data, channelId, ide, api_key = get_channel_id(session, resss, headers)
- title = formatted_json_data['title']
- accounts[counter] = [dict2, session, title, ide, channelId, api_key]
- subscribers = formatted_json_data['metric_subscriberCount']
- timeunic = formatted_json_data['timeCreatedSeconds']
- timeunic = datetime.datetime.fromtimestamp(int(timeunic)).strftime('%Y-%m-%d')
- monetized = formatted_json_data['isMonetized']
- verified = formatted_json_data['isNameVerified']
- all_accs += f'account №{counter}, subs:{subscribers}, monetized: {monetized}, verified: {verified}, created: {timeunic}, name: {title}\n'
- counter += 1
- except Exception:
- continue
- return accounts, all_accs
- def choose_account(accounts, selected_acc):
- try:
- cook = accounts[selected_acc][0]
- session = accounts[selected_acc][1]
- title = accounts[selected_acc][2]
- ide = accounts[selected_acc][3]
- channelId = accounts[selected_acc][4]
- api_key = accounts[selected_acc][5]
- return cook, session, title, ide, channelId, api_key
- except Exception as e:
- print('3', e)
- print('выбран неверный аккаунт')
- def get_header(session, channelId, my_cookies):
- try:
- headers = cookies_to_header(my_cookies)
- r = session.get(f'https://studio.youtube.com/channel/{channelId}/livestreaming', cookies = my_cookies, headers=headers)
- r = session.get('https://studio.youtube.com/channel/?approve_browser_access=1', cookies = my_cookies, headers=headers)
- if '<title>YouTube</title>' in r.text:
- print('не удалось войти в studio youtube')
- return
- unix_time = get_unix_time()
- headers = {}
- headers['referer'] = f'https://studio.youtube.com/channel/{channelId}/livestreaming'
- try:
- authorization = get_hash(f'{unix_time} {my_cookies.get("SAPISID")} https://studio.youtube.com')
- authorization = f'SAPISIDHASH {unix_time}_{authorization}'
- headers['authorization'] = authorization
- # headers['authorization'] = "SAPISIDHASH 1609150969_b144ab3586c89ff900cd783d66ca5d5fa63db8a0"
- except Exception as e:
- print(e)
- cookies = net_to_cookie("cookies.txt", "google")
- try:
- sapicid = cookies["SAPISID"]
- authorization = get_hash(f'{unix_time} {sapicid} https://studio.youtube.com')
- authorization = f'SAPISIDHASH {unix_time}_{authorization}'
- headers['authorization'] = authorization
- except Exception as e:
- print(e)
- return "нету SAPISID"
- # print(e)
- # return
- my_header_cookies = cookies_to_header(my_cookies)
- headers['Cookie'] = my_header_cookies['Cookie']
- headers['x-goog-authuser'] = '0'
- goog_visitor_id = r.text.split('"visitorData":"')[1].split('"')[0]
- headers['x-goog-visitor-id'] = goog_visitor_id
- youtube_client_version = r.text.split('"INNERTUBE_CONTEXT_CLIENT_VERSION":"')[1].split('"')[0]
- headers['x-youtube-client-version'] = youtube_client_version
- youtube_page_label = r.text.split('"productVersion":"')[1].split('"')[0]
- headers['x-youtube-page-label'] = youtube_page_label
- headers['x-origin'] = 'https://studio.youtube.com'
- headers['user-agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
- except Exception as e:
- # print('1', e)
- return
- return headers
- # GET_UNIX_TIME
- def get_unix_time():
- return int(time.time())
- # GET_HASH
- def get_hash(text):
- data = {'textToHash':text,
- 'hash-algorithm-used':'sha1'}
- r = requests.post('http://www.sha1-online.com/', data = data)
- soup = bs(r.text, 'html.parser')
- result = soup.find('span', attrs={'id':'result-sha1'})
- return result.text
- def get_ide_for_update(ide):
- ide = ide.split('||')
- if len(ide) == 2 and ide[1] == '':
- user = ""
- elif len(ide) == 2 and ide[1] != '':
- user = ide[0]
- else:
- input('Ошибка при создании стрима')
- sys.exit()
- return user
- def main_change(session, videoId, image, tags, category, ChannelId, Title, Description, headers, api_key, my_cookies, ide):
- user = get_ide_for_update(ide)
- with open(image, "rb") as image_file:
- encoded_string = base64.b64encode(image_file.read()).decode()
- if user:
- data = {"encryptedVideoId":videoId,"videoReadMask":{"channelId":True,"license":True,"publishing":{"all":True},"tags":{"all":True},"videoTrailers":{"all":True},"premiere":{"all":True},"gameTitle":{"all":True},"privacy":True,"titleFormattedString":{"all":True},"defaultCommentSortOrder":True,"livestream":{"all":True},"thumbnailEditorState":{"all":True},"description":True,"downloadUrl":True,"unlistedExpired":True,"videoPrechecks":{"all":True},"videoAdvertiserSpecificAgeGates":{"all":True},"visibility":{"all":True},"liveChat":{"all":True},"crowdsourcingEnabled":True,"thumbnailDetails":{"all":True},"selfCertification":{"all":True},"paidProductPlacement":True,"statusDetails":{"all":True},"origin":True,"sponsorsOnly":{"all":True},"videoStreamUrl":True,"ownedClaimDetails":{"all":True},"videoEditorProject":{"all":True},"originalFilename":True,"commentsDisabledInternally":True,"inlineEditProcessingStatus":True,"commentFilter":True,"location":{"all":True},"uncaptionedReason":True,"permissions":{"all":True},"descriptionFormattedString":{"all":True},"videoResolutions":{"all":True},"audienceRestriction":{"all":True},"responseStatus":{"all":True},"viewCountIsHidden":True,"audioLanguage":{"all":True},"allowComments":True,"allowEmbed":True,"status":True,"allowRatings":True,"videoDurationMs":True,"allRestrictions":{"all":True},"timePublishedSeconds":True,"metadataLanguage":{"all":True},"claimDetails":{"all":True},"features":{"all":True},"watchUrl":True,"timeCreatedSeconds":True,"dateRecorded":{"all":True},"videoId":True,"title":True,"category":True,"lengthSeconds":True,"draftStatus":True,"music":{"all":True},"scheduledPublishingDetails":{"all":True}},"title":{"newTitle":Title,"shouldSegment":True},"description":{"newDescription":Description,"shouldSegment":True},"videoStill":{"operation":"UPLOAD_CUSTOM_THUMBNAIL","image":{"dataUri":f"data:image/jpeg;base64,{encoded_string}"}},"tags":{"newTags":tags},"category":{"newCategoryId":category},"context":{"client":{"clientName":62,"clientVersion":"1.20201021.02.01-canary_control","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC44NTU5MDg5Njg1ODQ5Nzc3"},"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}}}
- else:
- data = {"encryptedVideoId":videoId,"videoReadMask":{"channelId":True,"license":True,"publishing":{"all":True},"tags":{"all":True},"videoTrailers":{"all":True},"premiere":{"all":True},"gameTitle":{"all":True},"privacy":True,"titleFormattedString":{"all":True},"defaultCommentSortOrder":True,"livestream":{"all":True},"thumbnailEditorState":{"all":True},"description":True,"downloadUrl":True,"unlistedExpired":True,"videoPrechecks":{"all":True},"videoAdvertiserSpecificAgeGates":{"all":True},"visibility":{"all":True},"liveChat":{"all":True},"crowdsourcingEnabled":True,"thumbnailDetails":{"all":True},"selfCertification":{"all":True},"paidProductPlacement":True,"statusDetails":{"all":True},"origin":True,"sponsorsOnly":{"all":True},"videoStreamUrl":True,"ownedClaimDetails":{"all":True},"videoEditorProject":{"all":True},"originalFilename":True,"commentsDisabledInternally":True,"inlineEditProcessingStatus":True,"commentFilter":True,"location":{"all":True},"uncaptionedReason":True,"permissions":{"all":True},"descriptionFormattedString":{"all":True},"videoResolutions":{"all":True},"audienceRestriction":{"all":True},"responseStatus":{"all":True},"viewCountIsHidden":True,"audioLanguage":{"all":True},"allowComments":True,"allowEmbed":True,"status":True,"allowRatings":True,"videoDurationMs":True,"allRestrictions":{"all":True},"timePublishedSeconds":True,"metadataLanguage":{"all":True},"claimDetails":{"all":True},"features":{"all":True},"watchUrl":True,"timeCreatedSeconds":True,"dateRecorded":{"all":True},"videoId":True,"title":True,"category":True,"lengthSeconds":True,"draftStatus":True,"music":{"all":True},"scheduledPublishingDetails":{"all":True}},"title":{"newTitle":Title,"shouldSegment":True},"description":{"newDescription":Description,"shouldSegment":True},"videoStill":{"operation":"UPLOAD_CUSTOM_THUMBNAIL","image":{"dataUri":f"data:image/jpeg;base64,{encoded_string}"}},"tags":{"newTags":tags},"category":{"newCategoryId":category},"context":{"client":{"clientName":62,"clientVersion":"1.20201021.02.01-canary_control","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC44NTU5MDg5Njg1ODQ5Nzc3"},"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data,
- headers=headers,
- cookies=my_cookies)
- # print(bs(r.text).text)
- # 1/0
- with open("main_change.txt", "w", encoding="utf-8") as f:
- f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'OK'
- else:
- return 'Ошибка изменения стрима'
- def check_likes(session, ChannelId, VideoId, api_key, headers, my_cookies, ide, likess):
- user = get_ide_for_update(ide)
- if likess:
- if user:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"permissions":{"all":True},"description":True,"videoDurationMs":True,"origin":True,"thumbnailDetails":{"all":True},"category":True,"uncaptionedReason":True,"allowComments":True,"livestream":{"all":True},"descriptionFormattedString":{"all":True},"publishing":{"all":True},"draftStatus":True,"features":{"all":True},"tags":{"all":True},"crowdsourcingEnabled":True,"downloadUrl":True,"metadataLanguage":{"all":True},"inlineEditProcessingStatus":True,"allowRatings":True,"license":True,"channelId":True,"viewCountIsHidden":True,"defaultCommentSortOrder":True,"lengthSeconds":True,"thumbnailEditorState":{"all":True},"premiere":{"all":True},"unlistedExpired":True,"videoTrailers":{"all":True},"commentsDisabledInternally":True,"allowEmbed":True,"audioLanguage":{"all":True},"dateRecorded":{"all":True},"commentFilter":True,"liveChat":{"all":True},"videoResolutions":{"all":True},"claimDetails":{"all":True},"selfCertification":{"all":True},"paidProductPlacement":True,"audienceRestriction":{"all":True},"visibility":{"all":True},"videoId":True,"privacy":True,"timePublishedSeconds":True,"videoAdvertiserSpecificAgeGates":{"all":True},"titleFormattedString":{"all":True},"videoPrechecks":{"all":True},"responseStatus":{"all":True},"location":{"all":True},"music":{"all":True},"allRestrictions":{"all":True},"sponsorsOnly":{"all":True},"status":True,"videoStreamUrl":True,"scheduledPublishingDetails":{"all":True},"gameTitle":{"all":True},"watchUrl":True,"timeCreatedSeconds":True,"videoEditorProject":{"all":True},"title":True,"originalFilename":True,"ownedClaimDetails":{"all":True},"statusDetails":{"all":True}},"commentOptions":{"newAllowComments":True,"newAllowCommentsMode":"AUTOMATED_COMMENTS","newCanViewRatings":True,"newDefaultSortOrder":"MDE_COMMENT_SORT_ORDER_TOP"},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC4yMjgwMzczNTM4ODQyMDMzMg.."},"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId}}
- else:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"dateRecorded":{"all":True},"selfCertification":{"all":True},"titleFormattedString":{"all":True},"status":True,"permissions":{"all":True},"timeCreatedSeconds":True,"videoTrailers":{"all":True},"metadataLanguage":{"all":True},"audienceRestriction":{"all":True},"commentsDisabledInternally":True,"videoEditorProject":{"all":True},"livestream":{"all":True},"allRestrictions":{"all":True},"videoStreamUrl":True,"license":True,"description":True,"allowEmbed":True,"crowdsourcingEnabled":True,"responseStatus":{"all":True},"draftStatus":True,"videoPrechecks":{"all":True},"thumbnailEditorState":{"all":True},"viewCountIsHidden":True,"videoAdvertiserSpecificAgeGates":{"all":True},"features":{"all":True},"videoResolutions":{"all":True},"thumbnailDetails":{"all":True},"statusDetails":{"all":True},"watchUrl":True,"timePublishedSeconds":True,"premiere":{"all":True},"videoDurationMs":True,"descriptionFormattedString":{"all":True},"lengthSeconds":True,"publishing":{"all":True},"uncaptionedReason":True,"claimDetails":{"all":True},"origin":True,"scheduledPublishingDetails":{"all":True},"videoId":True,"liveChat":{"all":True},"unlistedExpired":True,"paidProductPlacement":True,"location":{"all":True},"commentFilter":True,"visibility":{"all":True},"music":{"all":True},"channelId":True,"originalFilename":True,"tags":{"all":True},"allowComments":True,"allowRatings":True,"defaultCommentSortOrder":True,"downloadUrl":True,"title":True,"ownedClaimDetails":{"all":True},"sponsorsOnly":{"all":True},"privacy":True,"inlineEditProcessingStatus":True,"audioLanguage":{"all":True},"gameTitle":{"all":True},"category":True},"commentOptions":{"newAllowComments":True,"newAllowCommentsMode":"AUTOMATED_COMMENTS","newCanViewRatings":True,"newDefaultSortOrder":"MDE_COMMENT_SORT_ORDER_TOP"},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01-canary_control","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"false"},{"key":"force_live_chat_merchandise_upsell","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC43MDA2OTUxNjQ3OTk2MTEx"},"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data, headers=headers, cookies=my_cookies)
- # with open("check_likes.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'лайки включены'
- else:
- return 'не удалось включить лайки'
- else:
- if user:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"title":True,"originalFilename":True,"premiere":{"all":True},"allowEmbed":True,"responseStatus":{"all":True},"scheduledPublishingDetails":{"all":True},"permissions":{"all":True},"timeCreatedSeconds":True,"titleFormattedString":{"all":True},"tags":{"all":True},"crowdsourcingEnabled":True,"uncaptionedReason":True,"allowComments":True,"commentFilter":True,"privacy":True,"videoDurationMs":True,"status":True,"commentsDisabledInternally":True,"livestream":{"all":True},"license":True,"videoId":True,"metadataLanguage":{"all":True},"publishing":{"all":True},"videoTrailers":{"all":True},"videoEditorProject":{"all":True},"dateRecorded":{"all":True},"thumbnailDetails":{"all":True},"lengthSeconds":True,"videoStreamUrl":True,"statusDetails":{"all":True},"watchUrl":True,"location":{"all":True},"audioLanguage":{"all":True},"features":{"all":True},"timePublishedSeconds":True,"sponsorsOnly":{"all":True},"origin":True,"ownedClaimDetails":{"all":True},"claimDetails":{"all":True},"allRestrictions":{"all":True},"descriptionFormattedString":{"all":True},"videoPrechecks":{"all":True},"draftStatus":True,"videoResolutions":{"all":True},"allowRatings":True,"music":{"all":True},"thumbnailEditorState":{"all":True},"paidProductPlacement":True,"videoAdvertiserSpecificAgeGates":{"all":True},"gameTitle":{"all":True},"unlistedExpired":True,"inlineEditProcessingStatus":True,"defaultCommentSortOrder":True,"downloadUrl":True,"liveChat":{"all":True},"channelId":True,"category":True,"audienceRestriction":{"all":True},"visibility":{"all":True},"viewCountIsHidden":True,"description":True},"commentOptions":{"newAllowComments":True,"newAllowCommentsMode":"AUTOMATED_COMMENTS","newCanViewRatings":False,"newDefaultSortOrder":"MDE_COMMENT_SORT_ORDER_TOP"},"context":{"client":{"clientName":62,"clientVersion":"1.20201014.02.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC40MTY4MjkxODEwNzc4NTEz"},"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId}}
- else:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"lengthSeconds":True,"channelId":True,"commentFilter":True,"draftStatus":True,"privacy":True,"thumbnailDetails":{"all":True},"watchUrl":True,"ownedClaimDetails":{"all":True},"publishing":{"all":True},"title":True,"allowComments":True,"originalFilename":True,"category":True,"features":{"all":True},"inlineEditProcessingStatus":True,"tags":{"all":True},"paidProductPlacement":True,"videoAdvertiserSpecificAgeGates":{"all":True},"license":True,"location":{"all":True},"visibility":{"all":True},"metadataLanguage":{"all":True},"audioLanguage":{"all":True},"status":True,"videoPrechecks":{"all":True},"videoResolutions":{"all":True},"responseStatus":{"all":True},"uncaptionedReason":True,"downloadUrl":True,"videoId":True,"timeCreatedSeconds":True,"permissions":{"all":True},"gameTitle":{"all":True},"livestream":{"all":True},"music":{"all":True},"crowdsourcingEnabled":True,"timePublishedSeconds":True,"unlistedExpired":True,"viewCountIsHidden":True,"premiere":{"all":True},"commentsDisabledInternally":True,"dateRecorded":{"all":True},"defaultCommentSortOrder":True,"origin":True,"sponsorsOnly":{"all":True},"thumbnailEditorState":{"all":True},"description":True,"allowRatings":True,"videoDurationMs":True,"audienceRestriction":{"all":True},"videoStreamUrl":True,"allRestrictions":{"all":True},"videoTrailers":{"all":True},"claimDetails":{"all":True},"statusDetails":{"all":True},"titleFormattedString":{"all":True},"descriptionFormattedString":{"all":True},"videoEditorProject":{"all":True},"liveChat":{"all":True},"scheduledPublishingDetails":{"all":True},"allowEmbed":True},"commentOptions":{"newAllowComments":True,"newAllowCommentsMode":"AUTOMATED_COMMENTS","newCanViewRatings":False,"newDefaultSortOrder":"MDE_COMMENT_SORT_ORDER_TOP"},"liveChat":{"newLiveChatSettings":{"liveChatEnabled":False},"newLiveChatSettingsMask":{"liveChatEnabled":True}},"context":{"client":{"clientName":62,"clientVersion":"1.20201014.02.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC4zMjA1MTc3MTYwNTgxNTY5Mw.."},"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data, headers=headers, cookies=my_cookies)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'лайки отключены'
- else:
- return 'не удалось отключить лайки'
- def check_chat(session, ChannelId, VideoId, api_key, headers, my_cookies, ide, chatt):
- user = get_ide_for_update(ide)
- if chatt:
- if user:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"permissions":{"all":True},"description":True,"videoDurationMs":True,"origin":True,"thumbnailDetails":{"all":True},"category":True,"uncaptionedReason":True,"allowComments":True,"livestream":{"all":True},"descriptionFormattedString":{"all":True},"publishing":{"all":True},"draftStatus":True,"features":{"all":True},"tags":{"all":True},"crowdsourcingEnabled":True,"downloadUrl":True,"metadataLanguage":{"all":True},"inlineEditProcessingStatus":True,"allowRatings":True,"license":True,"channelId":True,"viewCountIsHidden":True,"defaultCommentSortOrder":True,"lengthSeconds":True,"thumbnailEditorState":{"all":True},"premiere":{"all":True},"unlistedExpired":True,"videoTrailers":{"all":True},"commentsDisabledInternally":True,"allowEmbed":True,"audioLanguage":{"all":True},"dateRecorded":{"all":True},"commentFilter":True,"liveChat":{"all":True},"videoResolutions":{"all":True},"claimDetails":{"all":True},"selfCertification":{"all":True},"paidProductPlacement":True,"audienceRestriction":{"all":True},"visibility":{"all":True},"videoId":True,"privacy":True,"timePublishedSeconds":True,"videoAdvertiserSpecificAgeGates":{"all":True},"titleFormattedString":{"all":True},"videoPrechecks":{"all":True},"responseStatus":{"all":True},"location":{"all":True},"music":{"all":True},"allRestrictions":{"all":True},"sponsorsOnly":{"all":True},"status":True,"videoStreamUrl":True,"scheduledPublishingDetails":{"all":True},"gameTitle":{"all":True},"watchUrl":True,"timeCreatedSeconds":True,"videoEditorProject":{"all":True},"title":True,"originalFilename":True,"ownedClaimDetails":{"all":True},"statusDetails":{"all":True}},"liveChat":{"newLiveChatSettings":{"liveChatEnabled":True},"newLiveChatSettingsMask":{"liveChatEnabled":True}},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC4yMjgwMzczNTM4ODQyMDMzMg.."},"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId}}
- else:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"dateRecorded":{"all":True},"selfCertification":{"all":True},"titleFormattedString":{"all":True},"status":True,"permissions":{"all":True},"timeCreatedSeconds":True,"videoTrailers":{"all":True},"metadataLanguage":{"all":True},"audienceRestriction":{"all":True},"commentsDisabledInternally":True,"videoEditorProject":{"all":True},"livestream":{"all":True},"allRestrictions":{"all":True},"videoStreamUrl":True,"license":True,"description":True,"allowEmbed":True,"crowdsourcingEnabled":True,"responseStatus":{"all":True},"draftStatus":True,"videoPrechecks":{"all":True},"thumbnailEditorState":{"all":True},"viewCountIsHidden":True,"videoAdvertiserSpecificAgeGates":{"all":True},"features":{"all":True},"videoResolutions":{"all":True},"thumbnailDetails":{"all":True},"statusDetails":{"all":True},"watchUrl":True,"timePublishedSeconds":True,"premiere":{"all":True},"videoDurationMs":True,"descriptionFormattedString":{"all":True},"lengthSeconds":True,"publishing":{"all":True},"uncaptionedReason":True,"claimDetails":{"all":True},"origin":True,"scheduledPublishingDetails":{"all":True},"videoId":True,"liveChat":{"all":True},"unlistedExpired":True,"paidProductPlacement":True,"location":{"all":True},"commentFilter":True,"visibility":{"all":True},"music":{"all":True},"channelId":True,"originalFilename":True,"tags":{"all":True},"allowComments":True,"allowRatings":True,"defaultCommentSortOrder":True,"downloadUrl":True,"title":True,"ownedClaimDetails":{"all":True},"sponsorsOnly":{"all":True},"privacy":True,"inlineEditProcessingStatus":True,"audioLanguage":{"all":True},"gameTitle":{"all":True},"category":True},"liveChat":{"newLiveChatSettings":{"liveChatEnabled":True},"newLiveChatSettingsMask":{"liveChatEnabled":True}},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01-canary_control","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"false"},{"key":"force_live_chat_merchandise_upsell","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC43MDA2OTUxNjQ3OTk2MTEx"},"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":ChannelId}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data, headers=headers, cookies=my_cookies)
- # with open("check_chat.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'чат включен'
- else:
- return 'не удалось включить чат'
- else:
- if user:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201014.02.00","hl":"ru","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}]},"user":{"onBehalfOfUser":user}},"encryptedVideoId":VideoId,"liveChat":{"newLiveChatSettings":{"liveChatEnabled":False},"newLiveChatSettingsMask":{"liveChatEnabled":True}}}
- else:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201009.02.00","hl":"ru","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}]}},"encryptedVideoId":VideoId,"liveChat":{"newLiveChatSettings":{"liveChatEnabled":False},"newLiveChatSettingsMask":{"liveChatEnabled":True}}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data, headers=headers, cookies=my_cookies)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'чат отключен'
- else:
- return 'не удалось отключить чат'
- def do_public(session, ChannelId, VideoId, api_key, headers, my_cookies, ide):
- user = get_ide_for_update(ide)
- if user:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"ownedClaimDetails":{"all":True},"location":{"all":True},"music":{"all":True},"videoDurationMs":True,"uncaptionedReason":True,"premiere":{"all":True},"allRestrictions":{"all":True},"dateRecorded":{"all":True},"metadataLanguage":{"all":True},"origin":True,"tags":{"all":True},"videoAdvertiserSpecificAgeGates":{"all":True},"responseStatus":{"all":True},"timeCreatedSeconds":True,"description":True,"videoPrechecks":{"all":True},"downloadUrl":True,"unlistedExpired":True,"features":{"all":True},"commentsDisabledInternally":True,"visibility":{"all":True},"statusDetails":{"all":True},"allowEmbed":True,"status":True,"category":True,"privacy":True,"publishing":{"all":True},"claimDetails":{"all":True},"videoStreamUrl":True,"videoTrailers":{"all":True},"videoId":True,"lengthSeconds":True,"liveChat":{"all":True},"descriptionFormattedString":{"all":True},"watchUrl":True,"channelId":True,"timePublishedSeconds":True,"paidProductPlacement":True,"thumbnailDetails":{"all":True},"defaultCommentSortOrder":True,"livestream":{"all":True},"audienceRestriction":{"all":True},"videoEditorProject":{"all":True},"inlineEditProcessingStatus":True,"gameTitle":{"all":True},"originalFilename":True,"allowRatings":True,"scheduledPublishingDetails":{"all":True},"audioLanguage":{"all":True},"titleFormattedString":{"all":True},"crowdsourcingEnabled":True,"title":True,"license":True,"selfCertification":{"all":True},"videoResolutions":{"all":True},"commentFilter":True,"sponsorsOnly":{"all":True},"thumbnailEditorState":{"all":True},"viewCountIsHidden":True,"allowComments":True,"permissions":{"all":True},"draftStatus":True},"privacyState":{"newPrivacy":"PUBLIC"},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC4xMjUzNTQwODUwNTg3OTA0Mg.."},"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}}}
- else:
- data = {"encryptedVideoId":VideoId,"videoReadMask":{"description":True,"privacy":True,"videoPrechecks":{"all":True},"audienceRestriction":{"all":True},"audioLanguage":{"all":True},"lengthSeconds":True,"thumbnailDetails":{"all":True},"titleFormattedString":{"all":True},"videoResolutions":{"all":True},"thumbnailEditorState":{"all":True},"music":{"all":True},"allowEmbed":True,"videoEditorProject":{"all":True},"origin":True,"premiere":{"all":True},"videoTrailers":{"all":True},"videoId":True,"sponsorsOnly":{"all":True},"scheduledPublishingDetails":{"all":True},"uncaptionedReason":True,"gameTitle":{"all":True},"inlineEditProcessingStatus":True,"publishing":{"all":True},"originalFilename":True,"claimDetails":{"all":True},"viewCountIsHidden":True,"timeCreatedSeconds":True,"permissions":{"all":True},"timePublishedSeconds":True,"descriptionFormattedString":{"all":True},"ownedClaimDetails":{"all":True},"visibility":{"all":True},"status":True,"defaultCommentSortOrder":True,"videoAdvertiserSpecificAgeGates":{"all":True},"liveChat":{"all":True},"watchUrl":True,"commentsDisabledInternally":True,"metadataLanguage":{"all":True},"allowRatings":True,"crowdsourcingEnabled":True,"selfCertification":{"all":True},"allRestrictions":{"all":True},"license":True,"statusDetails":{"all":True},"category":True,"downloadUrl":True,"location":{"all":True},"videoDurationMs":True,"commentFilter":True,"features":{"all":True},"tags":{"all":True},"dateRecorded":{"all":True},"title":True,"allowComments":True,"paidProductPlacement":True,"livestream":{"all":True},"videoStreamUrl":True,"draftStatus":True,"responseStatus":{"all":True},"unlistedExpired":True,"channelId":True},"privacyState":{"newPrivacy":"PUBLIC"},"context":{"client":{"clientName":62,"clientVersion":"1.20201102.01.01","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"False"},{"key":"force_live_chat_merchandise_upsell","value":"False"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC40Njk1MTQzODkxNDQxMDg5"},"delegationContext":{"externalChannelId":ChannelId,"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"}}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- json=data, headers=headers, cookies=my_cookies)
- # with open("do_public.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'паблик включен'
- else:
- return 'паблик не включился'
- def enable_moneytezation(session, api_key, videoID, headers, my_cookies, ide):
- user = get_ide_for_update(ide)
- if user:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201007.02.00","hl":"id","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}]},"user":{"onBehalfOfUser":user}},"encryptedVideoId":videoID,"monetizationSettings":{"newMonetizeWithAds":True}}
- else:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201007.02.00","hl":"id","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}]}},"encryptedVideoId":videoID,"monetizationSettings":{"newMonetizeWithAds":True}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- headers=headers, cookies=my_cookies, json=data)
- # with open("enable_moneytezation.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'монетизация включена'
- else:
- return 'монетизация не включена'
- def disable_video(session, api_key, videoID, headers, my_cookies, ide):
- user = get_ide_for_update(ide)
- if user:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201007.02.00","hl":"id","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}]},"user":{"onBehalfOfUser":user}},"encryptedVideoId":videoID, "liveStreamDvr":{"newEnableDvr":False}}
- else:
- data = {"context":{"client":{"clientName":62,"clientVersion":"1.20201007.02.00","hl":"id","gl":"RU","experimentIds":[],"experimentsToken":"","time_zone":"Asia/Yekaterinburg"},"capabilities":{},"request":{"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"False"},{"key":"force_route_delete_playlist_to_outertube","value":"False"}]}},"encryptedVideoId":videoID, "liveStreamDvr":{"newEnableDvr":False}}
- r = session.post(f'https://studio.youtube.com/youtubei/v1/video_manager/metadata_update?alt=json&key={api_key}',
- headers=headers, cookies=my_cookies, json=data)
- # with open("enable_moneytezation.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- if '"resultCode": "UPDATE_SUCCESS"' in r.text:
- return 'Видеорекордер отключен'
- else:
- return 'Видеорекордер не отключен'
- def change_first_name_and_last_name(session, api_key, channelId, headers, ide,
- first_name, last_name, past_name, my_cookies):
- user = get_ide_for_update(ide)
- if user:
- past_name = f"{first_name} {last_name}"
- data = {"externalChannelId":channelId,"titleUpdate":{"brandTitle":{"original":past_name,"originalLanguage":"","messages":[]}},"context":{"client":{"clientName":62,"clientVersion":"1.20201104.01.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"false"},{"key":"force_live_chat_merchandise_upsell","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":channelId},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC42NTU0MDA5MzE0MTk2MTc."}}
- else:
- data = {"externalChannelId":channelId,"titleUpdate":{"personalTitle":{"givenName":first_name,"familyName":last_name,"translations":{"original":past_name,"originalLanguage":"","messages":[]}}},"context":{"client":{"clientName":62,"clientVersion":"1.20201104.01.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_live_chat_merchandise_upsell","value":"false"},{"key":"force_route_delete_playlist_to_outertube","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":channelId},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC41OTQwNTMzODc1NjcxMTcy"}}
- url = f'https://studio.youtube.com/youtubei/v1/channel_edit/update_channel_page_settings?alt=json&key={api_key}'
- r = session.post(url, headers=headers, cookies=my_cookies, json=data)
- # with open('change_first_name_and_last_name.txt', 'w', encoding='utf-8') as f:
- # f.write(r.text)
- return 'название канала изменено'
- def change_country(session, api_key, headers, ide, channelId, my_cookies):
- user = get_ide_for_update(ide)
- if user:
- data = {"channelId":channelId,"commentsSettingsRequest":{},"studioSettingsRequest":{},"uploadDefaultsRequest":{},"asrFilteringRequest":{},"context":{"client":{"clientName":62,"clientVersion":"1.20201104.01.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"false"},{"key":"force_live_chat_merchandise_upsell","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"onBehalfOfUser":user,"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":channelId},"serializedDelegationContext":"EhhVQ2Q5QTh1azRreXVUMkYyQ29JOGg1clEqAggI"},"clientScreenNonce":"MC42NTU0MDA5MzE0MTk2MTc."},"channelReadMask":{"settings":{"all":True},"channelVisibility":True,"crosswalkStatus":{"all":True},"features":{"all":True},"title":True,"channelId":True,"permissions":{"all":True},"isOfficialArtistChannel":True,"isMonetized":True,"contracts":{"all":True},"isNameVerified":True,"sponsorships":{"all":True},"thumbnailDetails":{"all":True},"isPartner":True,"timeCreatedSeconds":True,"metric":{"all":True}}}
- else:
- data = {"channelId":channelId,"commentsSettingsRequest":{},"studioSettingsRequest":{},"uploadDefaultsRequest":{},"asrFilteringRequest":{},"context":{"client":{"clientName":62,"clientVersion":"1.20201104.01.00","hl":"ru","gl":"RU","experimentsToken":""},"request":{"returnLogEntry":True,"internalExperimentFlags":[{"key":"force_route_delete_playlist_to_outertube","value":"false"},{"key":"force_live_chat_merchandise_upsell","value":"false"}],"sessionInfo":{"token":"AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="}},"user":{"delegationContext":{"roleType":{"channelRoleType":"CREATOR_CHANNEL_ROLE_TYPE_OWNER"},"externalChannelId":channelId},"serializedDelegationContext":"EhhVQ212VzRKN3FrUi1BUFMwdW50YkttLVEqAggI"},"clientScreenNonce":"MC45Mjg4ODQ4ODMxNjcyNjk2"},"channelReadMask":{"settings":{"all":True},"channelVisibility":True,"crosswalkStatus":{"all":True},"features":{"all":True},"title":True,"channelId":True,"permissions":{"all":True},"isOfficialArtistChannel":True,"isMonetized":True,"contracts":{"all":True},"timeCreatedSeconds":True,"thumbnailDetails":{"all":True},"metric":{"all":True},"isPartner":True,"sponsorships":{"all":True},"isNameVerified":True}}
- url = f'https://studio.youtube.com/youtubei/v1/creator/update_creator_channel?alt=json&key={api_key}'
- r = session.post(url, headers=headers, cookies=my_cookies, json=data)
- # with open('change_country.txt', 'w', encoding='utf-8') as f:
- # f.write(r.text)
- if '"statusCode": "CREATOR_ENTITY_STATUS_OK"' in r.text:
- return 'сменил страну успешно'
- else:
- return 'не удалось изменить страну канала'
- def get_my_cookie():
- with open("cookies.json", encoding="utf-8") as f:
- data = json.loads(f.read())
- my_dict = {}
- for i in data:
- my_dict[i["name"]] = i["value"]
- return my_dict
- def main1():
- try:
- my_cookies = get_my_cookie()
- # my_cookies = net_to_cookie('cookies.txt', 'youtube') # -> ввести название файла
- links = all_accounts(my_cookies)
- accounts, all_accs = check_all_account(links, my_cookies)
- return accounts, all_accs
- except Exception as e:
- return 'error', e
- def main2(videoId, description, settings_file, image, selected_acc, accounts, folder):
- # try:
- settings_data = get_json_settings_from_file(file_name=settings_file)
- title = get_json_data_from_file(settings_data, key_='title')
- tags = get_json_data_from_file(settings_data, key_='tags').split(',')
- hide_s = get_json_data_from_file(settings_data, key_='hide_sub_count')
- tags = [tag.strip() for tag in tags]
- category = get_json_data_from_file(settings_data, key_='category', int_=True)
- description = work_with_file(file_name=description)
- first_name = get_json_data_from_file(settings_data, key_='first_name')
- last_name = get_json_data_from_file(settings_data, key_='last_name')
- likess = get_json_data_from_file(settings_data, key_='likes')
- chatt = get_json_data_from_file(settings_data, key_='chat')
- change_country_status = get_json_data_from_file(settings_data, key_='change_country')
- cook, session, title_of_account, ide, channelId, api_key = choose_account(accounts, selected_acc)
- my_cookies = cook
- headers = get_header(session, channelId, my_cookies)
- if headers != "нету SAPISID":
- res_main_change = main_change(session, videoId, image, tags, category, channelId, title, description, headers, api_key, my_cookies, ide)
- res_check_likes = check_likes(session, channelId, videoId, api_key, headers, my_cookies, ide, likess)
- res_check_chat = check_chat(session, channelId, videoId, api_key, headers, my_cookies, ide, chatt)
- res_do_public = do_public(session, channelId, videoId, api_key, headers, my_cookies, ide)
- res_enable_moneytezation = enable_moneytezation(session, api_key, videoId, headers, my_cookies, ide)
- res_vid = disable_video(session, api_key, videoId, headers, my_cookies, ide)
- res_baner = change_banner(session, api_key, videoId, headers, my_cookies, ide, folder, channelId)
- hide_videoss = hide_videos(session, api_key, videoId, headers, my_cookies, ide, folder, channelId)
- hide_likes = hide_videos(session, api_key, videoId, headers, my_cookies, ide, folder, channelId)
- hide_subss = hide_subs(session, api_key, videoId, headers, my_cookies, ide, folder, channelId, hide_s)
- if first_name and last_name:
- res_change_channel_name = change_first_name_and_last_name(session, api_key, channelId, headers, ide,
- first_name, last_name, title_of_account, my_cookies)
- else:
- res_change_channel_name = 'название канала не изменено'
- if change_country_status:
- res_change_country = change_country(session, api_key, headers, ide, channelId, my_cookies)
- else:
- res_change_country = 'страна канала не изменена'
- return res_main_change, res_check_likes, res_check_chat, res_do_public, res_enable_moneytezation, res_change_channel_name, res_change_country, res_vid, res_baner, hide_videoss, hide_subss
- else:
- return headers
- # except Exception as e:
- # return 'error', e, e, e, e, e, e
- if __name__ == "__main__":
- pass
- def change_banner(session, api_key, videoID, headers, my_cookies, ide, folder, channelId):
- try:
- file = folder+r'\banner.jpg'
- f = open(file, 'rb')
- files = {'files': f.read()}
- size = str(os.path.getsize(file))
- s = requests.Session()
- # print(size, f.seek(0, os.SEEK_END), f)
- hedr1 = {**headers,
- "authority": "www.youtube.com",
- "content-length": "0",
- "pragma": "no-cache",
- "x-goog-upload-protocol": "resumable",
- "x-goog-upload-header-content-length": size,
- "x-goog-upload-command": "start",
- "cache-control": "no-cache",
- "content-type": "application/x-www-form-urlencoded;charset=utf-8",
- "x-youtube-channelid": channelId,
- "accept": "*/*",
- "origin": "https://studio.youtube.com",
- "sec-fetch-site": "same-site",
- "sec-fetch-mode": "cors",
- "sec-fetch-dest": "empty",
- }
- r = session.post('https://www.youtube.com/channel_image_upload/banner', headers=hedr1, cookies=my_cookies)
- # print(r.status_code)
- upload_id = r.headers['X-GUploader-UploadID']
- # print(r.text, r.status_code)
- hedr0 = {**headers,
- "authority": "www.youtube.com",
- "pragma": "no-cache",
- "cache-control": "no-cache",
- "accept": "*/*",
- "access-control-request-method": "POST",
- "access-control-request-headers": "x-goog-upload-command,x-goog-upload-header-content-length,x-goog-upload-protocol,x-youtube-channelid",
- "origin": "https://studio.youtube.com",
- "sec-fetch-mode": "cors",
- "x-youtube-channelid": channelId,
- "content-length": size,
- "sec-fetch-site": "same-site",
- "sec-fetch-dest": "empty",
- }
- r = session.post('https://www.youtube.com/channel_image_upload/banner', headers=hedr0, files=files, cookies=my_cookies)
- enc_id = r.text.split('":"')[1][:-2]
- # print(r.status_code)
- # print(enc_id, r.text)
- hedr3 = {**headers,
- "authority": "studio.youtube.com",
- "pragma": "no-cache",
- "cache-control": "no-cache",
- # "x-youtube-delegation-context": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUEqAggI",
- "x-origin": "https://studio.youtube.com",
- "x-youtube-page-label": "youtube.studio.web_20201126_00_RC00",
- # "authorization": "SAPISIDHASH 1606641880_51401528104105e18d99cf7b7888f113487cadea",
- "content-type": "application/json",
- # "x-youtube-page-cl": "344383706",
- # "x-youtube-utc-offset": "120",
- # "x-youtube-client-name": "62",
- "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
- "x-youtube-client-version": "1.20201126.00.00",
- # "x-goog-authuser": "0",
- "x-youtube-time-zone": "Europe/Kiev",
- # "x-goog-visitor-id": "CgtUOWNtaV9WZDhlWSiy0Y3-BQ%3D%3D",
- # "x-youtube-ad-signals": "dt=1606641843311&flash=0&frm&u_tz=120&u_his=16&u_java&u_h=1080&u_w=1920&u_ah=1050&u_aw=1920&u_cd=24&u_nplug=3&u_nmime=4&bc=31&bih=949&biw=1879&brdim=0%2C0%2C0%2C0%2C1920%2C0%2C1920%2C1050%2C1879%2C949&vis=1&wgl=true&ca_type=image",
- "accept": "*/*",
- "origin": "https://studio.youtube.com",
- "sec-fetch-site": "same-origin",
- "sec-fetch-mode": "cors",
- "sec-fetch-dest": "empty",
- "referer": "https://studio.youtube.com/channel/"+channelId+"/editing/images",
- "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
- # "cookie": "VISITOR_INFO1_LIVE=T9cmi_Vd8eY; CONSENT=YES+UA.ru+20160721-10-0; NID=204=aWYUNUOZsYDVG2rzr5-dcQIpYcesP3w1yGshNPhD_q-6ikS0_w5Do4Xutc_AIQdwb6znAnmU8DbKfY5QdC6qYIjufExBGQ-QSHtvdRhsFo2Y6cwA32QDTm6uebri32OMajpPr31lwvgScOSh0gr9oHTlpBzBQ1p2IOK6T25IAjE; _gcl_au=1.1.1456209250.1605128410; PREF=al=ru&volume=100&f6=400&repeat=NONE&library_tab_browse_id=FEmusic_liked_videos&f5=30000; s_gl=da921031436d82404d81691fe6112514cwIAAABVQQ==; YSC=w7Z7j7AptvI; SID=4AeCiRucdL2D3rzsU-hcZ-ndWDqLaaTFmf8yST2qyMmbdAb-6JTyTjxyL4RpRgR88r_S4g.; __Secure-3PSID=4AeCiRucdL2D3rzsU-hcZ-ndWDqLaaTFmf8yST2qyMmbdAb-LbZOK9ae5BVZw76sOzwT1w.; HSID=AeOs9T5yObz0pgg8h; SSID=Ag0r4JKE0ilvxSEQ7; APISID=Q1yTix7v4T7RYpKq/ArTsC5md03ZFOX9n1; SAPISID=9bbTuSgHuvdc0a-r/AyLBLTJoekDEmlTdo; __Secure-3PAPISID=9bbTuSgHuvdc0a-r/AyLBLTJoekDEmlTdo; LOGIN_INFO=AFmmF2swRAIgcJ8RiezCgXJX8nveCTBhl8FL0niEJ--S-uY7pzkvJEMCIHWqdJNPivb1Uti9CO88WwB0dxKDuKaDpIa5onpLZhp9:QUQ3MjNmeVZOUlBBdU5JTHBsTzM5TXBQX2k0NlN1NlpLZy0zWTN2cFYyOWlrT3kzUFZjdWdTV21oeUVRV1Buc3hsanFvMzFPSVhwNHVIdHAtSVNSTHB6bmtVU2VfQ3FGQlI5QThXRkRYS0FHR3JJTmNrZjg5RzlyVDNrbzBSMl9BOU1tdjhwcU80T3hVYi1mYmR2LTR1WGRTd2JxRF9mNDkyRDNvWGEzdTlKUWJDc2gxaDR1SWZz; SIDCC=AJi4QfENDX1jR8g4lNLqxgoAzsty3t7kLsleCpATmD7mghO54VBKsm9B7o-HlGGul_z3DWyxPQ; __Secure-3PSIDCC=AJi4QfGkUfgImtgzXYMEwWDOnIlrF23Ox3DXP2GHaOV0eq_xtlM_QBQZkT_VCLTcGjbtnKLe2w",
- }
- # print(hedr3)
- # print(r.status_code, )
- # data = {"externalChannelId":channelId,}
- # user = get_ide_for_update(ide)
- user = get_ide_for_update(ide)
- data = {
- "externalChannelId": channelId,
- "bannerImageUpdate":
- {
- "encryptedBlobId": enc_id,
- },
- "context":
- {
- "client":
- {
- "clientName": 62,
- "clientVersion": "1.20201126.00.00",
- "hl": "ru",
- "gl": "UA",
- "experimentsToken": "",
- "utcOffsetMinutes": 120
- },
- "request":
- {
- "returnLogEntry": True,
- "sessionInfo":
- {
- "token": "AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="
- }
- },
- "user":
- {
- "delegationContext":
- {
- "externalChannelId": channelId,
- "roleType":
- {
- "channelRoleType": "CREATOR_CHANNEL_ROLE_TYPE_OWNER"
- }
- },
- "serializedDelegationContext": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUffgI11"
- },
- "clientScreenNonce": "MC44NDIxMTM5MTQ3MzEwNff211"
- }
- }
- r = session.post('https://studio.youtube.com/youtubei/v1/channel_edit/update_channel_page_settings?alt=json&key='+api_key, headers=hedr3, cookies=my_cookies, json=data)
- # print(r.text)
- print(r.status_code)
- # print(r.text)
- return 'шапка канала изменена'
- except:
- return 'шапка канала не изменена'
- def hide_videos(session, api_key, videoID, headers, my_cookies, ide, folder, channelId):
- data = {
- "channelId": channelId,
- "videoUpdate":
- {
- "privacyState":
- {
- "privacy": "VIDEO_UPDATE_PRIVACY_SETTING_PRIVATE"
- }
- },
- "filter":
- {
- "and":
- {
- "operands": [
- {
- "channelIdIs":
- {
- "value": channelId
- }
- }]
- }
- },
- "context":
- {
- "client":
- {
- "clientName": 62,
- "clientVersion": "1.20201126.00.00",
- "hl": "ru",
- "gl": "UA",
- "experimentsToken": "",
- "utcOffsetMinutes": 120
- },
- "request":
- {
- "returnLogEntry": True,
- "internalExperimentFlags": [
- {
- "key": "force_route_delete_playlist_to_outertube",
- "value": "false"
- },
- {
- "key": "force_live_chat_merchandise_upsell",
- "value": "false"
- }],
- "sessionInfo":
- {
- "token": "AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="
- }
- },
- "user":
- {
- "delegationContext":
- {
- "roleType":
- {
- "channelRoleType": "CREATOR_CHANNEL_ROLE_TYPE_OWNER"
- },
- "externalChannelId": channelId
- },
- "serializedDelegationContext": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUEqAggI"
- },
- "clientScreenNonce": "MC44NDIxMTM5MTQ3MzEwNjA2"
- }
- }
- # headers = {
- # **headers,
- # # "x-youtube-delegation-context": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUEqAggI",
- # "authorization": "SAPISIDHASH 1608500878_9ee5114b93921c950fc01974471b4bb722ff88e1",
- # }
- r = session.post(f'https://studio.youtube.com/youtubei/v1/creator/enqueue_creator_bulk_action?alt=json&key={api_key}',
- headers=headers, cookies=my_cookies, json=data)
- # with open("enable_moneytezation.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- print(r.text, r.status_code)
- if r.status_code == 200:
- return 'Все видео скрыты'
- else:
- return 'Видео не скрыты'
- def hide_subs(session, api_key, videoID, headers, my_cookies, ide, folder, channelId, hide_s):
- if hide_s:
- to_do = True
- else:
- to_do = False
- data = {
- "channelId": channelId,
- "coreSettingsRequest":
- {
- "hideSubscriberCount": to_do
- },
- "context":
- {
- "client":
- {
- "clientName": 62,
- "clientVersion": "1.20201126.00.00",
- "hl": "ru",
- "gl": "UA",
- "experimentsToken": "AbX5usaXVfeCnPijP6YY8BPXPVU-c8JOuqiBqHkf_Hve98xZjO4rDlLaLicnZy51XZ7xMgCQYU6BdtoHZvnVEiiYmCkIhQ==",
- "utcOffsetMinutes": 120
- },
- "request":
- {
- "returnLogEntry": True,
- "internalExperimentFlags": [
- {
- "key": "force_live_chat_merchandise_upsell",
- "value": "false"
- },
- {
- "key": "force_route_delete_playlist_to_outertube",
- "value": "false"
- }],
- "sessionInfo":
- {
- "token": "AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="
- }
- },
- "user":
- {
- "delegationContext":
- {
- "externalChannelId": channelId,
- "roleType":
- {
- "channelRoleType": "CREATOR_CHANNEL_ROLE_TYPE_OWNER"
- }
- },
- "serializedDelegationContext": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUEqAggI"
- },
- "clientScreenNonce": "MC44NDIxMTM5MTQ3MzEwNjA2"
- }
- }
- r = session.post(f'https://studio.youtube.com/youtubei/v1/creator/update_creator_channel?alt=json&key={api_key}', headers=headers, cookies=my_cookies, json=data)
- # with open("enable_moneytezation.txt", "w", encoding="utf-8") as f:
- # f.write(r.text)
- # print(r.text, r.status_code)
- if r.status_code == 200:
- return 'Кол-во подписчиков скрыто' if to_do else 'Кол-во подписчиков отображается'
- else:
- return 'Кол-во подписчиков ошибка'
- def get_new_sapid(session, client, token, auth, channel_id):
- data = {
- "channelId": channelId,
- "coreSettingsRequest":
- {
- "hideSubscriberCount": to_do
- },
- "commentsSettingsRequest":
- {},
- "studioSettingsRequest":
- {},
- "uploadDefaultsRequest":
- {},
- "asrFilteringRequest":
- {},
- "context":
- {
- "client":
- {
- "clientName": 62,
- "clientVersion": "1.20201126.00.00",
- "hl": "ru",
- "gl": "UA",
- "experimentsToken": "AbX5usaXVfeCnPijP6YY8BPXPVU-c8JOuqiBqHkf_Hve98xZjO4rDlLaLicnZy51XZ7xMgCQYU6BdtoHZvnVEiiYmCkIhQ==",
- "utcOffsetMinutes": 120
- },
- "request":
- {
- "returnLogEntry": True,
- "internalExperimentFlags": [
- {
- "key": "force_live_chat_merchandise_upsell",
- "value": "false"
- },
- {
- "key": "force_route_delete_playlist_to_outertube",
- "value": "false"
- }],
- "sessionInfo":
- {
- "token": "AbX5usaBxohyRP8Fvdefz5dZBGpfZelYW0jCPR9UPesyDalZ3-IIeVUl6NJ3hDIcS5kIYiAYXtG4MrSWTX_H84rufEd8ww=="
- }
- },
- "user":
- {
- "delegationContext":
- {
- "externalChannelId": channelId,
- "roleType":
- {
- "channelRoleType": "CREATOR_CHANNEL_ROLE_TYPE_OWNER"
- }
- },
- "serializedDelegationContext": "EhhVQ1RBeTBpdTdCa1A0VG1EQldyX1FicUEqAggI"
- },
- "clientScreenNonce": "MC44NDIxMTM5MTQ3MzEwNjA2"
- },
- "channelReadMask":
- {
- "settings":
- {
- "all": True
- },
- "channelVisibility": True,
- "crosswalkStatus":
- {
- "all": True
- },
- "features":
- {
- "all": True
- },
- "title": True,
- "channelId": True,
- "permissions":
- {
- "all": True
- },
- "isOfficialArtistChannel": True,
- "isMonetized": True,
- "contracts":
- {
- "all": True
- },
- "isNameVerified": True,
- "isPartner": True,
- "metric":
- {
- "all": True
- },
- "thumbnailDetails":
- {
- "all": True
- },
- "sponsorships":
- {
- "all": True
- },
- "timeCreatedSeconds": True
- }
- }
- r = session.post(f'https://studio.youtube.com/youtubei/v1/creator/update_creator_channel?alt=json&key={api_key}', headers=headers, cookies=my_cookies, json=data)
- return r.text, r.code
Add Comment
Please, Sign In to add comment