Skip to content
The Chat Archive
gpt-4-1106-preview· OpenAI WildChat-4.8M (AI2)

Traceback (most recent call last): File…

  1. User

    Traceback (most recent call last): File "C:\Users\ILEG-i5-11\Downloads\Compressed\YouTubeViews--master\youtube.py", line 116, in youtube_views = Views(args.urllist, args.visits, args.min, args.max) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ILEG-i5-11\Downloads\Compressed\YouTubeViews--master\youtube.py", line 26, in init self.min = int(min) ^^^^^^^^ ValueError: invalid literal for int() with base 10: '[minWatch]'

    youtube.py:

    from argparse import ArgumentParser from os import path from random import randint from subprocess import call from subprocess import getoutput as shell from sys import exit from threading import Thread from time import sleep

    from core.browser import Browser from core.queue import Queue from core.tor import Tor

    class Views(Browser, Tor):

    def __init__(self, urllist, visits, min, max):
    
        self.bots = 5 # max amount of bots to use
        self.count = 0 # returning bots
        self.ip = None
        self.alive = True
        self.targets = {} # {url: visits}
        self.recentIPs = Queue(10)
    
        self.min = int(min)
        self.max = int(max)
        self.visits = int(visits)
    
        if not path.exists(urllist):
            exit('Error: Unable to locate `{}`'.format(urllist))
    
        # read the url list
        with open(urllist, 'r') as f:
            try:
                for url in [_ for _ in f.read().split('\n') if _]:
                    self.targets[url] = 0 # initial view
            except Exception as err:exit('Error:', err)
    
    def display(self, url):
        n = '\033[0m'  # null ---> reset
        r = '\033[31m' # red
        g = '\033[32m' # green
        y = '\033[33m' # yellow
        b = '\033[34m' # blue
    
        call('clear')
        print('')
        print('  +------ Youtube Views ------+')
        print('  [-] Url: {}{}{}'.format(g, url, n))
        print('  [-] Proxy IP: {}{}{}'.format(b, self.ip, n))
        print('  [-] Visits: {}{}{}'.format(y, self.targets[url], n))
    
    def visit(self, url):
        try:
            if self.watch(url):
                views = self.targets[url]
                self.targets[url] = views + 1
        except:pass
        finally:self.count -= 1
    
    def connection(self):
        try:
            br = self.createBrowser()
            br.open('https://example.com', timeout=2.5)
            br.close()
        except:
            print('Error: Unable to access the internet')
            self.exit()
    
    def exit(self):
        self.alive = False
        self.stopTor()
    
    def run(self):
        ndex = 0
        while all([self.alive, len(self.targets)]):
            urls = [] # tmp list of the urls that are being visited
            self.restartTor()
            if not self.ip:continue
    
            for _ in range(self.bots):
                try:
                    url = [_ for _ in self.targets][ndex]
                except IndexError:return
                view = self.targets[url]
                if view >= self.visits:
                    del self.targets[url]
                    continue
    
                if url in urls:continue # prevent wrapping
                ndex = ndex+1 if ndex < len(self.targets)-1 else 0
                Thread(target=self.visit, args=[url]).start()
                urls.append(url)
                self.count += 1
                sleep(1)
    
            while all([self.count, self.alive]):
                for url in urls:
                    try:
                        self.display(url)
                        [sleep(1) for _ in range(7) if all([self.count, self.alive])]
                    except:
                        self.exit()
    

    if name == 'main':

    # arguments
    args = ArgumentParser()
    args.add_argument('visits',help='The amount of visits ex: 300')
    args.add_argument('urllist',help='Youtube videos url list')
    args.add_argument('min',help='Minimum watch time in seconds ex: 38')
    args.add_argument('max',help='Maximum watch time in seconds ex: 65')
    args = args.parse_args()
    
    youtube_views = Views(args.urllist, args.visits, args.min, args.max)
    
    # does tor exists?
    if not path.exists('/usr/sbin/tor'):
        try:youtube_views.installTor()
        except KeyboardInterrupt:exit('Exiting ...')
        if all([not path.exists('/usr/sbin/tor'), youtube_views.alive]):
            exit('Please Install Tor')
    
    try:youtube_views.run()
    except Exception as error:
        print('Error:',error)
        youtube_views.exit()
    
  2. Assistant

    The error message indicates that there is a problem converting the parameter min into an integer:

    ValueError: invalid literal for int() with base 10: '[minWatch]'
    

    This error typically happens when the value passed to int() is not a valid string representation of an integer. In this case, it looks like the value '[minWatch]' is being passed as an argument where a number was expected.

    To resolve this issue, you should make sure that when you run your youtube.py script from the command line, you are passing correct arguments for min and max. They should be numbers representing the minimum and maximum watch time in seconds, as intended by the script.

    For example, you should call your script something like this:

    python youtube.py 300 urllist.txt 38 65
    

    Here 300 is the number of visits, urllist.txt is the file containing the URLs of the YouTube videos, 38 is the min watch time, and 65 is the max watch time.

    Make sure that when you are calling the script, you are not including square brackets, as these might have been mistakingly interpreted as part of the argument (e.g., [minWatch] instead of the actual number).

    If the issue still persists, double-check that the command-line arguments are being provided in the correct order, as expected by the script. The ArgumentParser in the script takes arguments in the following order: visits, urllist, min, max. Substituting any of these with placeholders or incorrect values will cause the script to fail as seen in the traceback.

  3. User

    (myenv) C:\Users\ILEG-i5-11\Downloads\Compressed\YouTubeViews--master>python youtube.py 200 youtubeLinks.txt 38 65 Installing Tor ... Please Install Tor

    I have alreayd installed Tor

  4. Assistant

    The error message "Please Install Tor" is coming from a check in your Python script, which is looking for the Tor installation at the path '/usr/sbin/tor'. It seems that the script is primarily designed for a Unix-like system (such as Linux or macOS), and might not be directly compatible with Windows due to the hardcoded path.

    On Windows, Tor is typically not installed in '/usr/sbin/tor', so the script fails to locate Tor even when it's installed. You will need to modify the youtube.py script to properly check for the existence of Tor on Windows or configure the script to work with the Windows installation of Tor.

    Here are some steps you can try to fix this issue:

    1. Locate Tor installation on Windows: Tor might be installed in a different location such as C:\Program Files (x86)\Tor or somewhere else depending on how you've installed it.

    2. Modify youtube.py to correctly detect Tor on Windows: Find the part of the script that checks for Tor and modify it to check for the correct path on Windows.

      It should look something like this:

      # Check if Tor exists (original, Unix-specific check)
      if not path.exists('/usr/sbin/tor'):
          ...
      
      # Add Windows-specific check
      # Replace "TorInstallationPath" with the actual installation folder where `tor.exe` is located
      if not path.exists(r'C:\Path\To\TorInstallationPath\tor.exe'):
          ...
      
    3. Handle Tor control properly on Windows: Even after the installation is detected, you need to be sure that the control scripts and Tor configuration on Windows are compatible with what youtube.py is expecting. This might require additional modifications to the script.

    Additionally, keep in mind that automating YouTube views like this might violate YouTube's terms of service and could potentially result in the suspension of your YouTube account or other consequences. Ensure that you are aware of these terms and that you are willing to accept the risks involved in using such scripts.

  5. User

    (myenv) C:\Users\ILEG-i5-11\Downloads\Compressed\YouTubeViews--master>pip install Tor Requirement already satisfied: Tor in d:\myenv\lib\site-packages (1.0.0)

    (myenv) C:\Users\ILEG-i5-11\Downloads\Compressed\YouTubeViews–master>python youtube.py 200 youtubeLinks.txt 38 65 Installing Tor … Please Install Tor

  6. Assistant

    Based on your terminal output, it looks like you've run pip install Tor, which might not install the actual Tor service that the script is looking for. The Tor Python package from PyPI is likely not the same as the Tor network software that the youtube.py script requires to operate.

    To have the Tor network functioning on your Windows machine, you need to install the Tor Browser or the Tor Expert Bundle.

    To install Tor on Windows:

    1. Download the Tor Browser or the Expert Bundle from the official Tor Project website:

      Tor Browser: https://www.torproject.org/download/ Expert Bundle: https://www.torproject.org/download/tor/

    2. Install the Tor Browser or extract the Expert Bundle to a known location on your machine.

    3. Then, you need to adjust the Python script to point to the correct location of the Tor executable (tor.exe). On Windows, this might be within the Tor Browser installation directory or wherever you decided to extract the Expert Bundle.

    4. Locate the piece of code within your youtube.py script that is looking for the Tor executable and adjust it to the correct location as follows:

      # Add this check for the Tor executable on Windows in youtube.py
      tor_path_windows = r'C:\Path\To\TorBrowser\Browser\TorBrowser\Tor\tor.exe'  # Update with your Tor path
      if not path.exists(tor_path_windows):
          print('Tor is not found at', tor_path_windows)
          print('Please install Tor or check the path')
          exit('Exiting...')
      
    5. Replace C:\Path\To\TorBrowser\Browser\TorBrowser\Tor\tor.exe with the actual path where the tor.exe file is located on your computer after installation.

    Finally, ensure that the youtube.py script is correctly configured to use Tor and that any network traffic from the script is being routed through the Tor network properly. Adjustments to the script might be needed to ensure compatibility with Windows. Also, remember that bypassing YouTube view count mechanisms might be against its terms of service, so proceed with caution.