Comments (2)
Hey, so the biggest hack that I would use to get around this is adding an extra space after the @IceSpicee simply because I think the code that I wrote to perform the action chains to go through the upload process breaks down if there is not that there.
try:
while description:
nearest_mention = description.find('@')
nearest_hash = description.find('#')
if nearest_mention == 0 or nearest_hash == 0:
desc.send_keys('@' if nearest_mention == 0 else '#')
# wait for the frames to load
time.sleep(config['implicit_wait'])
name = description[1:].split(' ')[0]
if nearest_mention == 0: # @ case
mention_xpath = config['selectors']['upload']['mention_box']
condition = EC.presence_of_element_located((By.XPATH, mention_xpath))
mention_box = WebDriverWait(driver, config['explicit_wait']).until(condition)
mention_box.send_keys(name)
else:
desc.send_keys(name)
time.sleep(config['implicit_wait'])
if nearest_mention == 0: # @ case
mention_xpath = config['selectors']['upload']['mentions'].format('@' + name)
condition = EC.presence_of_element_located((By.XPATH, mention_xpath))
else:
hashtag_xpath = config['selectors']['upload']['hashtags'].format(name)
condition = EC.presence_of_element_located((By.XPATH, hashtag_xpath))
elem = WebDriverWait(driver, config['explicit_wait']).until(condition)
ActionChains(driver).move_to_element(elem).click(elem).perform()
description = description[len(name) + 2:] # this is the code which I think has the problem
else:
min_index = _get_splice_index(nearest_mention, nearest_hash, description)
desc.send_keys(description[:min_index])
description = description[min_index:]
except Exception as exception:
print('Failed to set description: ', exception)
_clear(desc)
desc.send_keys(saved_description) # if fail, use saved description
I am really sorry for writing code like this, very confusing as I tried too hard to not repeat myself I think.
from tiktok-uploader.
Hi bro, thank u for your response.
I have tested on windows (same as your demo, no modification) and it i was ok. So I think this issue only occurs on Linux (I tested in headless Chrome only, even I added extra space at end of description).
BTW, on headless chrome Linux, almost every try it will give error like that:
it can't access the upload page.
my server is Ubuntu 20: 4 vCores 8G RAM, it have ip v4 and v6, Chrome 114 latest.
PS: If i use headless param on your function it will show error:
I have to add option
options.add_argument('--headless=new')
options.add_argument('--no-sandbox')
Feel free to check it
Thank you.
from tiktok-uploader.
Related Issues (20)
- Error when running script with my cookies HOT 2
- FYP - Zero Viewers HOT 1
- CLI schedule error :( HOT 1
- Schedule switch id is changing HOT 1
- Failed to upload HOT 9
- Schedule and upload not work HOT 4
- Elelment not Found HOT 2
- The application is great, can you add an option to select affiliate products? HOT 1
- The issue of configuring proxy for Firefox HOT 3
- Low views with uploader. HOT 7
- Upload Button Not being Pressed HOT 1
- TikTok-Uploader Not Pressing Upload/ Error Uploading HOT 5
- Error while uploading video
- Solve the problem of 0 views HOT 9
- IT doesn't post at the end HOT 3
- Video uploaded successfully but does not appear in profile HOT 3
- How to start it? HOT 2
- video with description failed
- EOL while scanning string literal
- 0 Views in headless mode
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiktok-uploader.