Recently, some people are very interested in automatic uploading and Publishing , I've been talking to me several times in private . today , He must be arranged , You must be a fan of strength .
“ This article introduces the current mainstream short video platforms in turn ( Tiktok 、 Well quickly 、B standing 、 The little red book 、 Micro vision 、 Baidu good video 、 Watermelon Video 、 Wechat video Number 、 Sohu TV
frequency 、 One o'clock 、 Gale 、 Fun headlines ) Short videos are automatically published , Hope to help you more convenient 、 Efficient creation and management of we media .
One is video , The other is that the pixel size is not less than the cover of the video .
By calling the enabled browser , You can directly skip each login process .
Python Exchange of learning Q Group :660193417###
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_experimental_option
("debuggerAddress", "127.0.0.1:5003")
driver = webdriver.Chrome(options = options)
# Upload video
driver.find_element_by_xpath('//input
[@type="file"]').send_keys(path_mp4)
# Wait for the video upload to complete
while True:
time.sleep(3)
try:
driver.find_element_by_xpath('//*[contains(text()," Upload successful ")]')
break;
except Exception as e:
print(" The video is still uploading ···")
print(" Video upload completed !")
# Add cover
time.sleep(1)
driver.find_element_by_xpath('//*
[@class="el-upload"]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()
=" Custom cover "]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()
=" Select Picture "]/../..//input
[@type="file"]').send_keys(path_cover)
time.sleep(3)
driver.find_element_by_xpath('//*[text()
=" indeed set "]').click()
import selenium
from selenium import webdriver
import pathlib
import time
from selenium.webdriver.common.keys
import Keys
# essential information
# Video storage path
catalog_mp4 = r"C:\Users\Administrator\Desktop\ Video release "
# Video description describe = " Naked eye 3D Look at spider man # Funny # The movie # Visual shock "
time.sleep(10)
options = webdriver.ChromeOptions()
options.add_experimental_option
("debuggerAddress", "127.0.0.1:5003")
driver = webdriver.Chrome(options
= options)
path = pathlib.Path(catalog_mp4)
# Video address acquisition
path_mp4 = ""
for i in path.iterdir():
if(".mp4" in str(i)):
path_mp4 = str(i);
break;
if(path_mp4 != ""):
print(" Check the video path :" + path_mp4)
else:
print(" No video path detected , Termination of procedure !")
exit()
# Get the cover address
path_cover = ""
for i in path.iterdir():
if(".png" in str(i) or ".jpg" in str
(i)):
path_cover = str(i);
break;
if(path_cover != ""):
print(" Check the path to the cover page :" + path_cover)else:
print(" Cover path not checked , Termination of procedure !")
exit()
def publish_qutoutiao():
'''
effect : Post interesting headline video
'''
# Go to the creator page , And upload the video
driver.get
("https://mp.qutoutiao.net/publish-content/video")
time.sleep(2)
driver.find_element_by_xpath('//input[@type="file"]').send_keys(path_mp4)
# Wait for the video upload to complete
while True:
time.sleep(3)
try:
driver.find_element_by_xpath('//*[contains(text()," Upload successful ")]')
break;
except Exception as e:
print(" The video is still uploading ···")
print(" Video upload completed !")
# Enter title
driver.find_element_by_xpath('//*
[@placeholder=" Content title 5-30 word "]').
clear()
time.sleep(2)
driver.find_element_by_xpath('//*
[@placeholder=" Content title 5-30 word "]').send_keys
(describe)
# Enter a description
time.sleep(1)
driver.find_element_by_xpath
('//textarea').clear()
time.sleep(2)
driver.find_element_by_xpath
('//textarea').send_keys(describe)
# Select classification
time.sleep(1)
driver.find_element_by_xpath('//*[@placeholder=" Please select the category "]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()=" The movie "]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()=" classification :"]').click()
time.sleep(1)
# Enter the label
time.sleep(1)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').click()
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(" Visual shock ")
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(Keys.ENTER)
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(" Funny ")
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(Keys.ENTER)
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(" The movie ")
time.sleep(2)
driver.find_element_by_xpath('//*
[@class="content-tag"]//input').send_keys(Keys.ENTER)
# Add cover
time.sleep(1)
driver.find_element_by_xpath('//*
[@class="el-upload"]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()=" Custom cover "]').click()
time.sleep(1)
driver.find_element_by_xpath('//*[text()=" Select Picture "]/../..//input[@type="file"]').send_keys(path_cover)
time.sleep(3)
driver.find_element_by_xpath('//*[text()=" indeed set "]').click()
# Manual inspection and release
#time.sleep(3)
# Click publish
#driver.find_element_by_xpath('//*[text()=" Release "]').click()
# Start video Publishing publish_qutoutiao()
The tutorial on how to upload and publish automatically is put on it , Favorite friends can like the collection , If you have questions, please remember to comment and leave a message , Solve problems in time .