Skip to content

Commit

Permalink
add option headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedZEKRI authored and AhmedZEKRI committed Jun 21, 2021
1 parent 432daa3 commit 7a284db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Binary file modified geckodriver.exe
Binary file not shown.
5 changes: 4 additions & 1 deletion tiktok_no_water_mark.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def launch_download():
button["state"] = "normal"
return

kwargs = {'tiktok_url': url, 'headless': True}
kwargs = {'tiktok_url': url, 'headless': not non_headless}
proxy_password = re.findall(r'[\w\d]+://[\w\d.*+_?!]+:[\w\d.*+_?!]+@[\d.]+:[\d]+', proxy)
proxy_no_password = re.findall(r'[\w\d]+://[\d.]+:[\d]+', proxy)
if len(proxy_password) > 0 or len(proxy_no_password) > 0:
Expand Down Expand Up @@ -69,10 +69,13 @@ def launch_download():
parser.add_argument('-o', '--output', help="Specify thr file name in which the output file will be named in", )
parser.add_argument('-p', '--proxy', help="A proxy must follow the following pattern \n"
"protocol://username:password@host:port\n", )
parser.add_argument('-nh', '--non-headless', default=False, action='store_true',
help="Launch the web browser in non headless mode", )
args = parser.parse_args()
if '-url' not in sys.argv and ('-ng' in sys.argv or '--no-gui' in sys.argv):
raise parser.error('You must specify the tiktok url using -url in non gui mode')
no_gui = args.no_gui
non_headless = args.non_headless
window = tk.Tk()
if no_gui:
launch_download()
Expand Down

0 comments on commit 7a284db

Please sign in to comment.