Tkd-Alex / Twitch-Channel-Points-Miner-v2

A simple script that will watch a stream for you and earn the channel points.
GNU General Public License v3.0
1.21k stars 669 forks source link

dropCampaign exception #128

Closed Dennis-Mulder closed 3 years ago

Dennis-Mulder commented 3 years ago

Describe the bug An exception occurred while the script was running. After restarting the script I immediately get the same exception after it loaded the streamers.

Exception in thread Sync campaigns/inventory:
Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "C:\Program Files\Python39\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 561, in sync_campaigns
    campaigns_details = self.__get_campaigns_details(
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 501, in __get_campaigns_details
    return list(map(lambda x: x["data"]["user"]["dropCampaign"], response))
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 501, in <lambda>
    return list(map(lambda x: x["data"]["user"]["dropCampaign"], response))
TypeError: string indices must be integers

To Reproduce Unclear, it seems that there is a drop that causes an issue.

Expected behavior No exception in the console :)

Desktop (please complete the following information):

Additional context I'm on the latest version of the script (2f373bf)

Tkd-Alex commented 3 years ago

Did you know the drop? Or maybe we can find it based on your inventory?

Dennis-Mulder commented 3 years ago

It looks like this is the one, this is the only drop in my inventory. I don't have the Rust game. image https://www.twitch.tv/drops/campaigns?dropID=a7feb360-305b-4f9b-9d5b-b8df8d14e3a1

Signko commented 3 years ago

I don't use the drops function in the script since I don't play a lot of video games, but I get the same issue. Windows 10 Python v. 3.9.2

Tkd-Alex commented 3 years ago

Should be fixed in the related commit, please try :smile_cat:

Dennis-Mulder commented 3 years ago

I get an new error now when I start the script:

Exception in thread Sync campaigns/inventory:
Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "C:\Program Files\Python39\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 569, in sync_campaigns
    campaigns_details = self.__get_campaigns_details(
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 497, in __get_campaigns_details
    chunks = create_chunks(campaigns)
TypeError: create_chunks() missing 1 required positional argument: 'n'
Yishaqel commented 3 years ago

I get an new error now when I start the script:

Exception in thread Sync campaigns/inventory:
Traceback (most recent call last):
  File "C:\Program Files\Python39\lib\threading.py", line 954, in _bootstrap_inner
    self.run()
  File "C:\Program Files\Python39\lib\threading.py", line 892, in run
    self._target(*self._args, **self._kwargs)
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 569, in sync_campaigns
    campaigns_details = self.__get_campaigns_details(
  File "C:\opt\Twitch-Channel-Points-Miner-v2\TwitchChannelPointsMiner\classes\Twitch.py", line 497, in __get_campaigns_details
    chunks = create_chunks(campaigns)
TypeError: create_chunks() missing 1 required positional argument: 'n'

I guess we all received the same error after upgrading

Tkd-Alex commented 3 years ago

LoL, sorry it's bed time 💤 https://github.com/Tkd-Alex/Twitch-Channel-Points-Miner-v2/commit/f7856203fff4e59bca4fe63118fa8dee13984d54

Dennis-Mulder commented 3 years ago

Looks like it's fixed. I no longer get an exception while starting the script.

Tkd-Alex commented 3 years ago

Nice, after a few days please close the issue :)

zTigerrrr commented 3 years ago

I get the same error.

Tkd-Alex commented 3 years ago

I get the same error.

With the latest commit? :thinking:

zTigerrrr commented 3 years ago

I get the same error.

With the latest commit? 🤔

I have no clue. Sorry, but I don't really get how all of this works, the commits and all. I don't know how to upgrade the script either. I'm a total noob at all of this.

Tkd-Alex commented 3 years ago

@zTigerrrr You can try with git pull inside the directory or download again ^^

zTigerrrr commented 3 years ago

@zTigerrrr You can try with git pull inside the directory or download again ^^

I'm kind of ashamed of asking this, because it's probably dumb and you have tons of other things to do. But I have cloned the repository to GitHub Desktop and used fetch origin. I think this works? But I am just asking to be sure. :)

Tkd-Alex commented 3 years ago

@zTigerrrr You can try with git pull inside the directory or download again ^^

I'm kind of ashamed of asking this, because it's probably dumb and you have tons of other things to do. But I have cloned the repository to GitHub Desktop and used fetch origin. I think this works? But I am just asking to be sure. :)

Yup, should be OK The error still persist?