tanersb / TwitchRecover

65 stars 30 forks source link

IndexError: list index out of range #3

Closed u2716 closed 2 years ago

u2716 commented 2 years ago

python 3.10.5 , indexerror happens with both twitchtracker and streamcharts.

twitchtracker:


Date and Time are checking...
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/TwitchRecover/recover.py", line 270, in <module>
    timestamp = linkTimeCheck(link)
  File "/data/data/com.termux/files/home/TwitchRecover/recover.py", line 158, in linkTimeCheck
    print(f'Clock data:  {gelenveri[0].text}')
IndexError: list index out of range```
u2716 commented 2 years ago

streamcharts:


Date and Time are checking..
Traceback (most recent call last):
  File "/data/data/com.termux/files/home/TwitchRecover/recover.py", line 270, in <module>
    timestamp = linkTimeCheck(link)
  File "/data/data/com.termux/files/home/TwitchRecover/recover.py", line 80, in linkTimeCheck
    time = gelenveri[0].text
IndexError: list index out of range```
u2716 commented 2 years ago

I tried the stream links in the readme.md too with same results.

tanersb commented 2 years ago

It doesn't give me any errors. works for me. Can you be sure that there is no excess in the link? and Can you send the links too? @Victorbry99

tanersb commented 2 years ago

and there should be no spaces at the end of the link.

u2716 commented 2 years ago

tried again. now it works. it was probably an extra space.

https://twitchtracker.com/yungthasup/streams/39783759753

give no results though. it's a stream that happened yesterday,so it should still be in their servers.

tanersb commented 2 years ago

The reason is that the broadcast was also deleted from the servers. The sooner you search after being deleted from Twitch, the more positive results you will get. It didn't work that way until a few days ago. I think it's stored in a different server. I was trying to solve this situation, but I lost hope.

tanersb commented 2 years ago

I would be grateful if you let me know if you learn anything. Have a good day.

u2716 commented 2 years ago

thanks. If I find new servers domains, I'll tell you.Right now I'm taking a look at the issue section of java twitchrecover project to see if anyone solved this problem.

u2716 commented 2 years ago

It's strange. I'm getting indexerror again, with every link. I checked there are no extra spaces. I tried to add print = ('beg'+link+'end') and there are no extra spaces in the link printed beghttps://twitchtracker.com/yungthasup/streams/39783759753end .I tried also to do link.strip( ) to remove spaces but same error again. have any idea how to debug it? maybe I'm doing something wromg and I don't see it.

tanersb commented 2 years ago

I'll look tomorrow for the problem you said. And i can try fix.

u2716 commented 2 years ago

I added print(r) after r = requests.get(link) and I get <Response [403]> using streamscharts links and <Response [503]> using twitchtracker links. I think that's the problem.

u2716 commented 2 years ago

error 503 seems because I trigger ddos protection by cloudflare. if I do print(r.text), there is DDoS protection by <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing/" target="_blank">Cloudflare</a>

u2716 commented 2 years ago

now twitchtracker works again, streamscharts not. I tried implementing https://pypi.org/project/cloudscraper/ for bypassing cloudflare ddos protection that caused error 503 earlier on twitchtracker links.I don't know if it works yet.

tanersb commented 2 years ago

You can also enter the information manually if you want. Twitch name, hour, second,...