cooperhammond / irs

:guitar: :notes: A music downloader that understands your metadata needs.
MIT License
381 stars 26 forks source link

Captcha Cheat doesn't work #43

Closed nythepegasus closed 5 years ago

nythepegasus commented 6 years ago

The captcha cheat is a bit wonky. It'll open the browser with the link in mind, but then it gets the following error. It could be because of Python 3, but I dunno.

Traceback (most recent call last):
  File "/Users/Shared/workspace/python/venv3/env/bin/irs", line 11, in <module>
    sys.exit(main())
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/cli.py", line 80, in main
    ripper.spotify_list("playlist", args.playlist, args.username)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 356, in spotify_list
    locations = self.list(tracks)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 369, in list
    loc = self.song(track["name"], track["artist"], track)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 429, in song
    video_url, video_title = self.find_yt_url(song, artist)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 226, in find_yt_url
    return self.find_yt_url(song, artist, additional_search, caught_by_google, first, tries=tries + 1)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 226, in find_yt_url
    return self.find_yt_url(song, artist, additional_search, caught_by_google, first, tries=tries + 1)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 226, in find_yt_url
    return self.find_yt_url(song, artist, additional_search, caught_by_google, first, tries=tries + 1)
  [Previous line repeated 1 more times]
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 224, in find_yt_url
    return self.find_yt_url(song, artist, additional_search, caught_by_google, first=True, tries=tries + 1)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 234, in find_yt_url
    return self.find_yt_url(song=song, artist=artist, additional_search=additional_search, caught_by_google=True, tries=tries + 1)
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/ripper.py", line 159, in find_yt_url
    soup = BeautifulSoup(CaptchaCheat.cheat_it(link), 'html.parser')
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/utils.py", line 472, in cheat_it
    while CaptchaCheat.strip_it(b.evaluate_script("document.URL")) != CaptchaCheat.strip_it(url):
  File "/Users/Shared/workspace/python/venv3/env/lib/python3.6/site-packages/irs/utils.py", line 479, in strip_it
    s = s.strip("http://")
TypeError: a bytes-like object is required, not 'str'
cooperhammond commented 6 years ago

Sorry for being so slow getting back to you, AP testing is hell. Would you try it with python 2.7 and see if it still results in that error?

nythepegasus commented 6 years ago

Sorry for my late reply, python 2.7 got through about 6 videos, then it gets these errors:

ERROR: unable to download video data: <urlopen error [Errno 65] No route to host>
Traceback (most recent call last):
  File "/Users/nythepegasus/Library/Python/2.7/bin/irs", line 11, in <module>
    sys.exit(main())
  File "/Users/nythepegasus/Library/Python/2.7/lib/python/site-packages/irs/cli.py", line 82, in main
    console(ripper)
  File "/Users/nythepegasus/Library/Python/2.7/lib/python/site-packages/irs/utils.py", line 361, in console
    ripper.spotify_list("playlist", list_name, username)
  File "/Users/nythepegasus/Library/Python/2.7/lib/python/site-packages/irs/ripper.py", line 356, in spotify_list
    locations = self.list(tracks)
  File "/Users/nythepegasus/Library/Python/2.7/lib/python/site-packages/irs/ripper.py", line 369, in list
    loc = self.song(track["name"], track["artist"], track)
  File "/Users/nythepegasus/Library/Python/2.7/lib/python/site-packages/irs/ripper.py", line 453, in song
    ydl.download([video_url])
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1993, in download
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 800, in extract_info
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 854, in process_ie_result
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1627, in process_video_result
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1902, in process_info
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 617, in report_error
  File "/Users/nythepegasus/.irs/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 587, in trouble
youtube_dl.utils.DownloadError: ERROR: unable to download video data: <urlopen error [Errno 65] No route to host>
cooperhammond commented 5 years ago

55 removed the captcha cheat entirely. It'll be coming back in a cleaner way later.