Skip to content

Commit

Permalink
Merge pull request #317 from davidteather/nightly
Browse files Browse the repository at this point in the history
V3.6.1
  • Loading branch information
davidteather authored Nov 5, 2020
2 parents cf18461 + 7bed3a0 commit 3fb031c
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 160 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ dist/*
test.mp4
test.txt
.pytest_cache/*
tests/__pycache__/*
tests/__pycache__/*
*.pyc
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,16 @@ results = 10
trending = api.trending(count=results)
for tiktok in trending:
# Prints the text of the tiktok
print(tiktok['desc'])
# Prints the id of the tiktok
print(tiktok['id'])
print(len(trending))
```

To run the example scripts from the repository root, make sure you use the
module form of python the interpreter

```sh
```
python -m examples.getTrending
```

Expand Down
Binary file removed TikTokApi/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/browser.cpython-37.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/browser.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/get_acrawler.cpython-37.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/get_acrawler.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/stealth.cpython-37.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/stealth.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/tiktok.cpython-37.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/tiktok.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/tiktokuser.cpython-38.pyc
Binary file not shown.
Binary file removed TikTokApi/__pycache__/user.cpython-38.pyc
Binary file not shown.
37 changes: 28 additions & 9 deletions TikTokApi/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ def set_async():
global async_support
async_support = True

options = {}
def custom_options(to_add):
global options
options = to_add

args = []
def custom_args(to_add):
global args
args = to_add

class browser:
def __init__(
Expand All @@ -37,15 +46,23 @@ def __init__(
find_redirect = kwargs.get("find_redirect", False)

self.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36"
self.args = [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-infobars",
"--window-position=0,0",
"--ignore-certifcate-errors",
"--ignore-certifcate-errors-spki-list",
"--user-agent=" + self.userAgent,
]

global args
global options

if len(args) == 0:
self.args = [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-infobars",
"--window-position=0,0",
"--ignore-certifcate-errors",
"--ignore-certifcate-errors-spki-list",
"--user-agent=" + self.userAgent,
]
else:
self.args = args
self.args.append("--user-agent=" + self.userAgent)

if self.proxy != None:
if "@" in self.proxy:
Expand All @@ -69,6 +86,8 @@ def __init__(
"handleSIGHUP": False,
}

self.options.update(options)

if self.executablePath != None:
self.options["executablePath"] = self.executablePath

Expand Down
Loading

0 comments on commit 3fb031c

Please sign in to comment.