everythingdd

Open tiktok in browser

Aug 6th, 2021 (edited)
209
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import webbrowser
  2. import sys
  3. import re
  4.  
  5. for i in range(1, len(sys.argv)):
  6.     pid = re.search(r'(6|7)\d{18}', sys.argv[i].split('\\')[-1]).group(0)
  7.     url = 'https://www.tiktok.com/share/video/' + pid
  8.    
  9.     webbrowser.register('chrome',
  10.         None,
  11.         webbrowser.BackgroundBrowser("C://Program Files (x86)//Google//Chrome//Application//chrome.exe")) # Change to your browser here
  12.     webbrowser.get('chrome').open(url)
RAW Paste Data