Git Product home page Git Product logo

irs's Introduction

irs: The Ironic Repositioning System

made-with-crystal License: MIT Say Thanks

A music scraper that understands your metadata needs.

irs is a command-line application that downloads audio and metadata in order to package an mp3 with both. Extensible, the user can download individual songs, entire albums, or playlists from Spotify.

forthebadge forthebadge forthebadge


Table of Contents

Usage

~ $ irs -h

Usage: irs [--help] [--version] [--install]
           [-s <song> -a <artist>]
           [-A <album> -a <artist>]
           [-p <playlist> -a <username>]

Arguments:
    -h, --help                  Show this help message and exit
    -v, --version               Show the program version and exit
    -i, --install               Download binaries to config location
    -c, --config                Show config file location
    -a, --artist <artist>       Specify artist name for downloading
    -s, --song <song>           Specify song name to download
    -A, --album <album>         Specify the album name to download
    -p, --playlist <playlist>   Specify the playlist name to download
    -u, --url <url>             Specify the youtube url to download from (for single songs only)
    -g, --give-url              Specify the youtube url sources while downloading (for albums or playlists only only)

Examples:
    $ irs --song "Bohemian Rhapsody" --artist "Queen"
    # => downloads the song "Bohemian Rhapsody" by "Queen"
    $ irs --album "Demon Days" --artist "Gorillaz"
    # => downloads the album "Demon Days" by "Gorillaz"
    $ irs --playlist "a different drummer" --artist "prakkillian"
    # => downloads the playlist "a different drummer" by the user prakkillian

Demo

asciicast

Installation

Pre-built

Just download the latest release for your platform here.

Note that the binaries right now have only been tested on WSL. They should run on most linux distros, and OS X, but if they don't please make an issue above.

From Source

If you're one of those cool people who compiles from source

  1. Install crystal-lang (https://crystal-lang.org/install/)
  2. Clone it (git clone https://github.com/cooperhammond/irs)
  3. CD it (cd irs)
  4. Build it (shards build)

Setup

  1. Create a .yaml config file somewhere on your system (usually ~/.irs/)
  2. Copy the following into it
    binary_directory: ~/.irs/bin
    music_directory: ~/Music
    filename_pattern: "{track_number} - {title}"
    directory_pattern: "{artist}/{album}"
    client_key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    client_secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    single_folder_playlist:
        enabled: true
        retain_playlist_order: true
        unify_into_album: false
  3. Set the environment variable IRS_CONFIG_LOCATION pointing to that file
  4. Go to https://developer.spotify.com/dashboard/
  5. Log in or create an account
  6. Click CREATE A CLIENT ID
  7. Enter all necessary info, true or false, continue
  8. Find your client key and client secret
  9. Copy each respectively into the X's in your config file
  10. Run irs --install and answer the prompts!

You should be good to go! Run the file from your command line to get more help on usage or keep reading!

Config

You may have noticed that there's a config file with more than a few options. Here's what they do:

binary_directory: ~/.irs/bin
music_directory: ~/Music
search_terms: "lyrics"
filename_pattern: "{track_number} - {title}"
directory_pattern: "{artist}/{album}"
client_key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
client_secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
single_folder_playlist:
    enabled: true
    retain_playlist_order: true
    unify_into_album: false
  • binary_directory: a path specifying where the downloaded binaries should be placed
  • music_directory: a path specifying where downloaded mp3s should be placed.
  • search_terms: additional search terms to plug into youtube, which can be potentially useful for not grabbing erroneous audio.
  • filename_pattern: a pattern for the output filename of the mp3
  • directory_pattern: a pattern for the folder structure your mp3s are saved in
  • client_key: a client key from your spotify API application
  • client_secret: a client secret key from your spotify API application
  • single_folder_playlist/enabled: if set to true, all mp3s from a downloaded playlist will be placed in the same folder.
  • single_folder_playlist/retain_playlist_order: if set to true, the track numbers of the mp3s of the playlist will be overwritten to correspond to their place in the playlist
  • single_folder_playlist/unify_into_album: if set to true, will overwrite the album name and album image of the mp3 with the title of your playlist and the image for your playlist respectively

In a pattern following keywords will be replaced:

Keyword Replacement Example
{artist} Artist Name Queen
{title} Track Title Bohemian Rhapsody
{album} Album Name Stone Cold Classics
{track_number} Track Number 9
{total_tracks} Total Tracks in Album 14
{disc_number} Disc Number 1
{day} Release Day 01
{month} Release Month 01
{year} Release Year 2006
{id} Spotify ID 6l8GvAyoUZwWDgF1e4822w

Beware OS-restrictions when naming your mp3s.

Pattern Examples:

music_directory: ~/Music
filename_pattern: "{track_number} - {title}"
directory_pattern: "{artist}/{album}"

Outputs: ~/Music/Queen/Stone Cold Classics/9 - Bohemian Rhapsody.mp3

music_directory: ~/Music
filename_pattern: "{artist} - {title}"
directory_pattern: ""

Outputs: ~/Music/Queen - Bohemian Rhapsody.mp3

music_directory: ~/Music
filename_pattern: "{track_number} of {total_tracks} - {title}"
directory_pattern: "{year}/{artist}/{album}"

Outputs: ~/Music/2006/Queen/Stone Cold Classics/9 of 14 - Bohemian Rhapsody.mp3

music_directory: ~/Music
filename_pattern: "{track_number}. {title}"
directory_pattern: "irs/{artist} - {album}"

Outputs: ~/Music/irs/Queen - Stone Cold Classics/9. Bohemian Rhapsody.mp3

How it works

At it's core irs downloads individual songs. It does this by interfacing with the Spotify API, grabbing metadata, and then searching Youtube for a video containing the song's audio. It will download the video using youtube-dl, extract the audio using ffmpeg, and then pack the audio and metadata together into an MP3.

From the core, it has been extended to download the index of albums and playlists through the spotify API, and then iteratively use the method above for downloading each song.

It used to be in python, but

  1. I wasn't a fan of python's limited ability to distribute standalone binaries
  2. It was a charlie foxtrot of code that I made when I was little and I wanted to refine it
  3. crystal-lang made some promises and I was interested in seeing how well it did (verdict: if you're building high-level tools you want to run quickly and distribute, it's perfect)

Contributing

Any and all contributions are welcome. If you think of a cool feature, send a PR or shoot me an email. If you think something could be implemented better, please shoot me an email. If you like what I'm doing here, pretty please shoot me an email.

  1. Fork it (https://github.com/your-github-user/irs/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

irs's People

Contributors

aubguillemette avatar cooperhammond avatar imsamuka avatar luca-schlecker avatar mrandri19 avatar who23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

irs's Issues

"Distribution not found" Error when starting IRS

Zorin OS 12 xenial

$ irs
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
    @_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2940, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 635, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 943, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'requests' distribution was not found and is required by irs

Compile error -- `Error: undefined method 'mapping' for JSON:Module`

I ran shards build --release and got this:

Dependencies are satisfied
Building: irs
Error target irs failed to compile:
Using compiled compiler at /home/g/Public/software/crystal/.build/crystal
Showing last frame. Use --error-trace for full trace.

In src/glue/mapper.cr:4:8

 4 | JSON.mapping(
          ^------
Error: undefined method 'mapping' for JSON:Module

with --error-trace:

Dependencies are satisfied
Building: irs
Error target irs failed to compile:
Using compiled compiler at /home/g/Public/software/crystal/.build/crystal
In src/irs.cr:1:1

 1 | require "./bottle/cli"
     ^
Error: while requiring "./bottle/cli"


In src/bottle/cli.cr:3:1

 3 | require "./config"
     ^
Error: while requiring "./config"


In src/bottle/config.cr:5:1

 5 | require "../search/spotify"
     ^
Error: while requiring "../search/spotify"


In src/search/spotify.cr:5:1

 5 | require "../glue/mapper"
     ^
Error: while requiring "../glue/mapper"


In src/glue/mapper.cr:4:8

 4 | JSON.mapping(
          ^------
Error: undefined method 'mapping' for JSON:Module

JSON:Module trace:

  src/glue/mapper.cr:4

      JSON.mapping(

The weird fact is, that on the Crystal's api there is documentation for JSON#mapping(), so Idk what to do

EDIT: JSON#mapping(_properties_, strict = false) and JSON#mapping(**_properties_) are deprecated, you should use JSON::Serializable

No token provided?

I thought I had put my app tokens in the right file, but any time I try to dl something I get the following error?

Here's one from me trying to find "Moontalk" by Laurel Halo.

Traceback (most recent call last):
File "/Users/caleb/anaconda/bin/irs", line 11, in
load_entry_point('irs==6.7.6', 'console_scripts', 'irs')()
File "/Users/caleb/anaconda/lib/python3.6/site-packages/irs/cli.py", line 82, in main
console(ripper)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/irs/utils.py", line 350, in console
ripper.song(song_name, artist_name)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/irs/ripper.py", line 421, in song
data = self.parse_song_data(song, artist)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/irs/ripper.py", line 382, in parse_song_data
album, track = find_album_and_track(song, artist, self.spotify)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/irs/metadata.py", line 60, in find_album_and_track
tracks = spotify.search(q=song, type="track")["tracks"]["items"]
File "/Users/caleb/anaconda/lib/python3.6/site-packages/spotipy/client.py", line 339, in search
return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/spotipy/client.py", line 146, in _get
return self._internal_call('GET', url, payload, kwargs)
File "/Users/caleb/anaconda/lib/python3.6/site-packages/spotipy/client.py", line 124, in _internal_call
headers=r.headers)
spotipy.client.SpotifyException: http status: 401, code:-1 - https://api.spotify.com/v1/search?q=Moontalk&limit=10&offset=0&type=track:
No token provided

Have I put my tokens into the wrong files?

Bug when searching for one song

Just typed irs, then 1 and test

What type of media would you like to download?
        1) Song
        2) Album
        3) Playlist
:: 1
Song you would like to download : test
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/irs/__main__.py", line 112, in main
    manager.console()
  File "/usr/local/lib/python3.5/dist-packages/irs/manager.py", line 47, in console
    self.rip_mp3()
  File "/usr/local/lib/python3.5/dist-packages/irs/manager.py", line 234, in rip_mp3
    audio_code = self.find_mp3(song=song, artist=artist)
  File "/usr/local/lib/python3.5/dist-packages/irs/manager.py", line 65, in find_mp3
    print (color(song, ["BOLD", "UNDERLINE"]) + ' by ' + color(artist, ["BOLD", "UNDERLINE"]))
  File "/usr/local/lib/python3.5/dist-packages/irs/utils.py", line 58, in color
    return (bc.ENDC + eval(color_string) + text + bc.ENDC)
TypeError: Can't convert 'NoneType' object to str implicitly

Unexpected char

irs --song "Bohemian Rhapsody" --artist "Queen"
Unexpected char 'u' at 1:2

01

And nothing is downloaded ๐Ÿ˜Ÿ

Compilation error: undefined local variable or method 'future' for Logger

Running the install from source instructions exactly on Ubuntu 20.04.1 LTS (WSL 2), I get Error: undefined local variable or method 'future' for Logger.

This is the full stack trace:

$ shards build
Dependencies are satisfied
Building: irs
Error target irs failed to compile:
In src/glue/mapper.cr:4:8

 4 | JSON.mapping(
          ^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)

In src/glue/mapper.cr:4:3

 4 | JSON.mapping(
     ^
Warning: expanding macro


There was a problem expanding macro 'mapping'

Called macro defined in /usr/share/crystal/src/json/mapping.cr:232:3

 232 | macro mapping(**_properties_)

Which expanded to:

 > 1 |     ::JSON.mapping({tracks: {type: PlaylistTracksMapper, setter: true}, id: String, images: JSON::Any, name: String, owner: JSON::Any, type: String})
   2 |
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)

In src/glue/mapper.cr:18:8

 18 | JSON.mapping(
           ^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)

In src/glue/mapper.cr:28:8

 28 | JSON.mapping(
           ^------
Warning: Deprecated JSON.mapping. use JSON::Serializable instead (the legacy behaviour is also available in a shard at github:crystal-lang/json_mapping.cr)

In src/glue/album.cr:12:7

 12 | def find_it
          ^------
Warning: this method overrides SpotifyList#find_it() which has an explicit return type of JSON::Any.

Please add an explicit return type (JSON::Any or a subtype of it) to this method as well.

The above warning will become an error in a future Crystal version.

In src/glue/playlist.cr:16:7

 16 | def find_it
          ^------
Warning: this method overrides SpotifyList#find_it() which has an explicit return type of JSON::Any.

Please add an explicit return type (JSON::Any or a subtype of it) to this method as well.

The above warning will become an error in a future Crystal version.

A total of 6 warnings were found.
Showing last frame. Use --error-trace for full trace.

In src/interact/logger.cr:41:14

 41 | called = future {
               ^-----
Error: undefined local variable or method 'future' for Logger

This is my crystal version, if it helps

$ crystal --version
Crystal 0.35.1 [5999ae29b] (2020-06-19)

LLVM: 8.0.0
Default target: x86_64-unknown-linux-gnu

Better video sources

After looking at the source I saw that the program tries to pick lyric videos, which I understand, because of many reasons, but can you please try to add an experimental switch that tries to instead search using a string like this song + " " + artist + " audio" which I think may work better in some cases because some lyric videos have poor audio quality (try downloading the F.E.A.R. album by Papa Roach using the app and compare the quality with the original music videos). Maybe in the future I can come up with an algorithm that tries to pick the video with the best quality myself and file a pull request but right now I suggest you try the idea I told you above. And thanks for this cool program.

Issue downloading

So the script starts up fine. The spotify token works. I run Python 3.6.6

But when i try to download, i encounter this error:
Album name: currents
Album: "b'Currents'" by "b'Tame Impala'"
Finding Youtube link ...
Downloading "Let It Happen" by "Tame Impala"
Converting to mp3 ...
ERROR: WARNING: unable to obtain file audio codec with ffprobe
Traceback (most recent call last):
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2047, in post_process
files_to_delete, info = pp.run(info)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\postprocessor\ffmpeg.py", line 243, in run
raise PostProcessingError('WARNING: unable to obtain file audio codec with ffprobe')
youtube_dl.utils.PostProcessingError: WARNING: unable to obtain file audio codec with ffprobe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\magnus\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Magnus\AppData\Local\Programs\Python\Python36\Scripts\irs.exe_main
.py", line 9, in
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\irs\cli.py", line 82, in main
console(ripper)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\irs\utils.py", line 354, in console
ripper.spotify_list("album", album_name)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\irs\ripper.py", line 356, in spotify_list
locations = self.list(tracks)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\irs\ripper.py", line 369, in list
loc = self.song(track["name"], track["artist"], track)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\irs\ripper.py", line 453, in song
ydl.download([video_url])
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2001, in download
url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 803, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 857, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 1635, in process_video_result
self.process_info(new_info)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 1982, in process_info
self.post_process(filename, info_dict)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 2049, in post_process
self.report_error(e.msg)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 620, in report_error
self.trouble(error_message, tb)
File "c:\users\magnus\appdata\local\programs\python\python36\lib\site-packages\youtube_dl\YoutubeDL.py", line 590, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: WARNING: unable to obtain file audio codec with ffprobe

I have ffprobe installed with pip, so dont see why there would be a error

KeyError: 'name'

artists name: Myon x Fatum feat. Marcus Bently
song name: Rain

python3 /usr/local/bin/irs -a "Myon x Fatum feat. Marcus Bently" -s "Rain"

Finding Youtube Link ...
Finding Youtube Link ...
Downloading "Rain" by "Myon x Fatum feat. Marcus Bently" ...
Converting to mp3 ...
Traceback (most recent call last):
File "/usr/local/bin/irs", line 9, in
load_entry_point('irs==6.2.2', 'console_scripts', 'irs')()
File "/usr/local/lib/python3.5/dist-packages/irs-6.2.2-py3.5.egg/irs/cli.py", line 53, in main
ripper.song(args.song, args.artist)
File "/usr/local/lib/python3.5/dist-packages/irs-6.2.2-py3.5.egg/irs/ripper.py", line 335, in song
m.add_tag( "title", data["name"])
KeyError: 'name'

unicode choking on '

$ irs -u "xxxxxxxxxxxx" -p "Proximity"

Traceback (most recent call last):
File "/usr/bin/irs", line 11, in
load_entry_point('irs==6.2.2', 'console_scripts', 'irs')()
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/cli.py", line 57, in main
ripper.spotify_list("playlist", args.playlist, args.username)
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/ripper.py", line 234, in spotify_list
locations = self.list(tracks)
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/ripper.py", line 247, in list
loc = self.song(track["name"], track["artist"], track)
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/ripper.py", line 300, in song
video_url, video_title = self.find_yt_url(song, artist)
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/ripper.py", line 112, in find_yt_url
query_string = urlencode({"search_query" : (search_terms)})
File "/usr/lib64/python2.7/urllib.py", line 1326, in urlencode
v = quote_plus(str(v))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 6: ordinal not in range(128)

irs seems to be having a problem with the single apostrophe in the track "It Ain't Me (with Selena Gomez) - Kygo, Selena Gomez"

Need to find a way for irs to not halt on error as well as log to info/stdout that it wasn't able to parse or process track...skip to next track instead of dump to traceback.

Also update application version (6.22 > 6.23) on every commit. I want to make sure I'm working with the correct version.

There's no config set up. Set up a configuration folder by running `irs --setup`

hi i am using windows 10 python 3.8.2 Just finnished setting up and im getting the error above saying the .irs config folder isn't there runing "irs -- setup" creates the folders with 2 .exe files in .bin and a config.yml i will attach screenshots of both the error and the .irs folder

Error
Capture
.irs Folder
Capture
bin Folder in .irs Folder
Capture

AttributeError: 'dict' object has no attribute 'iteritems'

I keep getting this error when trying to download a spotify playlist.

information

irs -u "spotify" -p "Coffee Table Jazz"
Traceback (most recent call last):
  File "/usr/bin/irs", line 11, in <module>
    load_entry_point('irs==6.3.4', 'console_scripts', 'irs')()
  File "/usr/lib/python3.6/site-packages/irs/cli.py", line 59, in main
    ripper_args = dict((k, v) for k, v in ripper_args.iteritems() if v)
AttributeError: 'dict' object has no attribute 'iteritems'

Youtube organization changed

Hi,
I tried to use your app for the first time using the latest prebuilt binary but when I try to download some song I'm prompted with this error. Should I compile latest IRS to fix this?

Traceback:

michal@Michal-PC:~/Downloads/IRS$ ./irs --artist "Alynda Segarra" --song "Drunken Angel"
[Drunken Angel by Alynda Segarra]
  + Metadata found
Youtube has changed the way it organizes its webpage, submit a bug
on https://github.com/cooperhammond/irs

irs/config_preset

Thanks for looking at the authorisation bug. After updating to the newer irs version (6.6.1), there seems to be an error coming up during setup.

Here's the error from the terminal:

irs --setup

"ffmpeg" is already downloaded!
"ffprobe" is already downloaded!
Traceback (most recent call last):
File "/usr/local/bin/irs", line 11, in
load_entry_point('irs==6.6.1', 'console_scripts', 'irs')()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 560, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2648, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2302, in load
return self.resolve()
File "/usr/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2308, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/site-packages/irs/init.py", line 13, in
setup()
File "/usr/local/lib/python2.7/site-packages/irs/setup_binaries.py", line 12, in setup
copyfile("irs/config_preset", config_file)
File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'irs/config_preset'

Is there supposed to be a file named config_present in the irs folder which holds the tokens or maybe i am missing something on my installation ?

Thanks for your help.

Specify YouTube source

Is there a way to add a specific YouTube url for download with a Spotify song or album instead of hoping that the selection algorithm gets it right? It works well most of the time, but occasionally, it has downloaded and converted a video of the entire album multiple times over, which is tedious to fix manually.

print (bc.HEADER + "Artist of song/album ", end="")

Wanted to try this, but isnt working.

โ•ญโ”€artpar at artpar-lenovo in ~/Music using
โ•ฐโ”€โ—‹ irs -a "Tool" -A "10000 days"
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 7, in <module>
    from irs.__main__ import main
  File "/usr/local/lib/python2.7/dist-packages/irs/__main__.py", line 51
    print (bc.HEADER + "Artist of song/album ", end="")
                                                   ^
SyntaxError: invalid syntax
โ•ญโ”€artpar at artpar-lenovo in ~/Music using
โ•ฐโ”€โ—‹ irs -a "Tool" -s "Come as you are"
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 7, in <module>
    from irs.__main__ import main
  File "/usr/local/lib/python2.7/dist-packages/irs/__main__.py", line 51
    print (bc.HEADER + "Artist of song/album ", end="")
                                                   ^
SyntaxError: invalid syntax
โ•ญโ”€artpar at artpar-lenovo in ~/Music using
โ•ฐโ”€โ—‹ python --version 
Python 2.7.12
โ•ญโ”€artpar at artpar-lenovo in ~/Music using
โ•ฐโ”€โ—‹ uname -a
Linux artpar-lenovo 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
โ•ญโ”€artpar at artpar-lenovo in ~/Music using
โ•ฐโ”€โ—‹ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.1 LTS
Release:	16.04
Codename:	xenial

Captcha Cheat doesn't work

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'

AttributeError: 'NoneType' object has no attribute 'split'

$ irs -u "xxxxxxxxxxxxxx" -p "Rap Nation"
Playlist: "Rap Nation" by "xxxxxxxxxxxxx"
Traceback (most recent call last):
File "/usr/bin/irs", line 11, in
load_entry_point('irs==6.2.2', 'console_scripts', 'irs')()
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/cli.py", line 57, in main
ripper.spotify_list("playlist", args.playlist, args.username)
File "/usr/lib/python2.7/site-packages/irs-6.2.2-py2.7.egg/irs/ripper.py", line 214, in spotify_list
album = self.spotify.album(track["album"]["uri"])
File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 302, in album
trid = self._get_id('album', album_id)
File "/usr/lib/python2.7/site-packages/spotipy/client.py", line 846, in _get_id
fields = id.split(':')
AttributeError: 'NoneType' object has no attribute 'split'

Configure directory of download

How do I configure what parent directory the files should download to? Currently irs downloading to root directory (/) which is undesirable for my case.
image

Wrong extension given for config file in readme

In the readme it is given as the extension of config file is .yaml whereas the correct extension is yml . Please correct it.

And also is there any way I could use it on my Raspberry Pi as it is ARM architecture ? I have installed crystal from this repo.

I am trying to compile it with your repo but it says unsupported shard.lock It was likely generated from a newer version of shards. My shards version is 0.8.1

Edit : Tried with your 1.0.0 branch and it compiled but if I use it, it says metadata found and after that says There were no results for that query and says Unhandled exception : There was no URL found on youtube for ... .
I'd be very happy if you could help me get your program running on the Raspberry Pi 4. Thank you

Exception on macOS Sierra

irs -u "someuser"
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 7, in <module>
    from irs.__main__ import main
  File "/usr/local/lib/python2.7/site-packages/irs/__main__.py", line 47, in <module>
    from .manager import Manager
  File "/usr/local/lib/python2.7/site-packages/irs/manager.py", line 78
    print (bc.YELLOW + "\nFinding youtube link ...", end="\r")
                                                        ^
SyntaxError: invalid syntax
$ python --version
Python 2.7.12

Re: No such file or directory: 'irs/config_preset'

Hello,

Sorry for bugging you with this issue again. I love using 'irs' regularly and wondering how to get it up running again.

So far i have tried reinstalling the whole package with all dependencies but facing the same error as below.

Error message from the terminal:

Indrajits-MacBook-Pro:~ Indrajit$ irs
Traceback (most recent call last):
File "/usr/local/bin/irs", line 7, in
from irs.cli import main
File "/usr/local/lib/python2.7/site-packages/irs/init.py", line 20, in
from .ripper import Ripper
File "/usr/local/lib/python2.7/site-packages/irs/ripper.py", line 21, in
from .utils import YdlUtils, ObjManip, Config
File "/usr/local/lib/python2.7/site-packages/irs/utils.py", line 20, in
import config
File "/usr/local/lib/python2.7/site-packages/irs/config.py", line 11, in
config = open("irs/config_preset", "r").read()
IOError: [Errno 2] No such file or directory: 'irs/config_preset'
Indrajits-MacBook-Pro:~ Indrajit$ irs --setup
"ffmpeg" is already downloaded!
"ffprobe" is already downloaded!
Traceback (most recent call last):
File "/usr/local/bin/irs", line 7, in
from irs.cli import main
File "/usr/local/lib/python2.7/site-packages/irs/init.py", line 13, in
setup()
File "/usr/local/lib/python2.7/site-packages/irs/setup_binaries.py", line 12, in setup
copyfile("irs/config_preset", config_file)
File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 82, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: 'irs/config_preset'

Is there anything i am missing ? I also tried to check the .irs folder in my $HOME folder and the only folder i find a 'bin' folder but no file named config_preset.

Any help on this Sir ? Thanks a lot..

Missing hash-key: "give-url" (KeyError) when trying to run with only album & artist

Unhandled exception: Missing hash key: "give-url" (KeyError)
  from ../../usr/share/crystal/src/hash.cr:1027:11 in '[]'
  from docs/irs/src/bottle/cli.cr:95:19 in 'act_on_args'
  from docs/irs/src/irs.cr:5:3 in 'main'
  from docs/irs/src/irs.cr:8:1 in '__crystal_main'
  from ../../usr/share/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
  from ../../usr/share/crystal/src/crystal/main.cr:91:7 in 'main'
  from ../../usr/share/crystal/src/crystal/main.cr:114:3 in 'main'
  from __libc_start_main
  from _start
  from ???

Ran this irs --album "Demon Days" --artist "Gorillaz"

No error thrown when running irs --song "Bohemian Rhapsody" --artist "Queen"

Error when downloading a big playlist

When trying to download a big playlist, it crashes after the line Trying to bypass google captcha.
This line occurs after downloading some tracks.

The error is the following:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/irs/ripper.py", line 229, in find_yt_url
    return ("https://youtube.com" + self.code["href"], self.code["title"])
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/chromedriver': '/usr/local/bin/chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/irs", line 11, in <module>
    load_entry_point('irs==6.7.6', 'console_scripts', 'irs')()
  File "/usr/lib/python3.6/site-packages/irs/cli.py", line 82, in main
    console(ripper)
  File "/usr/lib/python3.6/site-packages/irs/utils.py", line 361, in console
    ripper.spotify_list("playlist", list_name, username)
  File "/usr/lib/python3.6/site-packages/irs/ripper.py", line 356, in spotify_list
    locations = self.list(tracks)
  File "/usr/lib/python3.6/site-packages/irs/ripper.py", line 369, in list
    loc = self.song(track["name"], track["artist"], track)
  File "/usr/lib/python3.6/site-packages/irs/ripper.py", line 429, in song
    video_url, video_title = self.find_yt_url(song, artist)
  File "/usr/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 "/usr/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 "/usr/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 "/usr/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 "/usr/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 "/usr/lib/python3.6/site-packages/irs/ripper.py", line 159, in find_yt_url
    soup = BeautifulSoup(CaptchaCheat.cheat_it(link), 'html.parser')
  File "/usr/lib/python3.6/site-packages/irs/utils.py", line 469, in cheat_it
    with Browser('chrome', **executable_path) as b:
  File "/usr/lib/python3.6/site-packages/splinter/browser.py", line 63, in Browser
    return driver(*args, **kwargs)
  File "/usr/lib/python3.6/site-packages/splinter/driver/webdriver/chrome.py", line 35, in __init__
    self.driver = Chrome(chrome_options=options, **kwargs)
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 68, in __init__
    self.service.start()
  File "/usr/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

Also, executing whereis chromedriver produces /usr/bin/chromedriver, and /usr/bin is in PATH.

Thank you

Signature Extraction Failed

Ubuntu 16.04 python 2.7

ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 905, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 797, in _extract_signature_function
    raise ExtractorError('Cannot identify player %r' % player_url)
ExtractorError: Cannot identify player u'/yts/jsbin/player_ias-vflH-Ze7P/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
 (caused by ExtractorError(u"Cannot identify player u'/yts/jsbin/player_ias-vflH-Ze7P/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/irs", line 9, in <module>
    load_entry_point('irs==6.7.7', 'console_scripts', 'irs')()
  File "/usr/local/lib/python2.7/dist-packages/irs/cli.py", line 82, in main
    console(ripper)
  File "/usr/local/lib/python2.7/dist-packages/irs/utils.py", line 350, in console
    ripper.song(song_name, artist_name)
  File "/usr/local/lib/python2.7/dist-packages/irs/ripper.py", line 453, in song
    ydl.download([video_url])
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1692, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 681, in extract_info
    self.report_error(compat_str(e), e.format_traceback())
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 541, in report_error
    self.trouble(error_message, tb)
  File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 511, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 905, in _decrypt_signature
    video_id, player_url, s
  File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/youtube.py", line 797, in _extract_signature_function
    raise ExtractorError('Cannot identify player %r' % player_url)
ExtractorError: Cannot identify player u'/yts/jsbin/player_ias-vflH-Ze7P/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
 (caused by ExtractorError(u"Cannot identify player u'/yts/jsbin/player_ias-vflH-Ze7P/en_US/base.js'; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

Could Not Find Playlist when User is Spotify (sometimes)

When running irs -u spotify -p "Coffee Table Jazz" I receive this error:
Could not find any lists.

But, when running irs -u spotify -p "Peaceful Piano", it downloads the songs

Edit: I'm testing on other Spotify playlists, not all playlists are working even though irs is authenticated with Spotify.

add videourl to metadata

Feature request:
Can you add an option which can be set in the config file to include or not include (by default) the video_url to the comments/description field. It'd be nice to pass in --video-url option that adds the youtube video URL in the mp3 comments or description field. Doesn't have to be enabled by default but this would be a nice to have so mp3s can be tracked back to youtube source.

No token provided

I am encountering an issue since start of this june. I guess spotify needs to refresh tokens or some other stuff for every request made. So far i have found this as an reference to the issue.

Since May 29th 2017, EVERY request needs to be authorized. :(
They announced it in their web...
https://developer.spotify.com/news-stories/2017/01/27/removing-unauthenticated-calls-to-the-web-api/

I really dont have any experience as how to solve this issue. Any one can help me through ?

Below is the error i receive in the terminal :-

Traceback (most recent call last):
File "/usr/local/bin/irs", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/irs/cli.py", line 75, in main
console(ripper)
File "/usr/local/lib/python2.7/site-packages/irs/utils.py", line 314, in console
ripper.song(song_name, artist_name)
File "/usr/local/lib/python2.7/site-packages/irs/ripper.py", line 348, in song
data = self.parse_song_data(song, artist)
File "/usr/local/lib/python2.7/site-packages/irs/ripper.py", line 309, in parse_song_data
album, track = find_album_and_track(song, artist)
File "/usr/local/lib/python2.7/site-packages/irs/metadata.py", line 60, in find_album_and_track
tracks = spotipy.Spotify().search(q=song, type="track"
File "/usr/local/lib/python2.7/site-packages/spotipy/client.py", line 339, in search
return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)
File "/usr/local/lib/python2.7/site-packages/spotipy/client.py", line 146, in _get
return self._internal_call('GET', url, payload, kwargs)
File "/usr/local/lib/python2.7/site-packages/spotipy/client.py", line 124, in _internal_call
headers=r.headers)
spotipy.client.SpotifyException: http status: 401, code:-1 - https://api.spotify.com/v1/search?q=s&type=track&limit=10&offset=0:
No token provided

Program hangs on download

I'm running this via source (i.e. cloning, compiling). I've copied irs to my home directory for convenience, in case that matters. Behaviour is the same running from home or cd'ing into repo/bin/ and running from the binary there.

When I run irs to get a song or an album, it successfully gets to "Downloading video" and then appears to completely hang, like this:

./irs --song "Bohemian Rhapsody" --artist "Queen"
[Bohemian Rhapsody by Queen]
  + Metadata found
  + URL found
  Downloading video:

(for an album:)

./irs --album "On Air" --artist "Queen"
+ On Air by Queen
[1/24]
[My Fairy King - BBC Session / February 5th 1973, Langham 1 Studio by Queen]
  + URL found
  Downloading video:

I left it for 15 minutes just in case, but it stayed hanging at that point.

KeyError: 'name'

~/irs$ irs -a "Ashley Wallbridge" -s "Goa (Extended Mix)"
Traceback (most recent call last):
File "/usr/local/bin/irs", line 9, in
load_entry_point('irs==6.2.2', 'console_scripts', 'irs')()
File "/usr/local/lib/python3.5/dist-packages/irs-6.2.2-py3.5.egg/irs/cli.py", line 53, in main
ripper.song(args.song, args.artist)
File "/usr/local/lib/python3.5/dist-packages/irs-6.2.2-py3.5.egg/irs/ripper.py", line 293, in song
song = data["name"]
KeyError: 'name'

Cant get past irs --install

I compiled irs following the directions, I made the config.yml file, and I set the IRS_CONFIG_LOCATION variable. But I cant get past This warning message.
image
Any ideas?

Exception in spotipy

System:

MBP 2015
OSX El Capitan
Python 3.5.1 :: Anaconda 2.5.0 (x86_64)

Trace:

Traceback (most recent call last):
  File "/Users/my/stuff/anaconda3/bin/irs", line 11, in <module>
    sys.exit(main())
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/irs/__main__.py", line 106, in main
    manager.rip_spotify_list("album")
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/irs/manager.py", line 157, in rip_spotify_list
    results = spotify.search(q=search, type=type)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/spotipy/client.py", line 339, in search
    return self._get('search', q=q, limit=limit, offset=offset, type=type, market=market)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/spotipy/client.py", line 146, in _get
    return self._internal_call('GET', url, payload, kwargs)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/spotipy/client.py", line 108, in _internal_call
    r = self._session.request(method, url, headers=headers, proxies=self.proxies, **args)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connectionpool.py", line 835, in _validate_conn
    conn.connect()
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/connection.py", line 330, in connect
    cert = self.sock.getpeercert()
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 324, in getpeercert
    'subjectAltName': get_subj_alt_name(x509)
  File "/Users/my/stuff/anaconda3/lib/python3.5/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 171, in get_subj_alt_name
    ext = cert.extensions.get_extension_for_class(
AttributeError: 'Extensions' object has no attribute 'get_extension_for_class'

tput: unknown terminal "xterm-termite"

Hi there,

So i've just installed irs, from within a conda env, followed the instructions and got this error:

tput: unknown terminal "xterm-termite"

To install irs i did as follows:

  • Created an empty conda env
  • Installed Python 3.7 and pip in it by using "conda install python"
  • Installed irs using pip without sudo (not required to use sudo in conda env)
  • Ran irs --setup
  • Got the following error when i ran the command "irs":

tput: unknown terminal "xterm-termite"
Traceback (most recent call last):
File "/home/undercover/.conda/envs/irs/bin/irs", line 6, in
from irs.cli import main
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/irs/init.py", line 20, in
from .ripper import Ripper
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/irs/ripper.py", line 21, in
from .utils import YdlUtils, ObjManip, Config, CaptchaCheat
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/irs/utils.py", line 461, in
from splinter import Browser
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/splinter/init.py", line 5, in
from splinter.browser import Browser # NOQA
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/splinter/browser.py", line 9, in
from splinter.driver.webdriver.firefox import WebDriver as FirefoxWebDriver
File "/home/undercover/.conda/envs/irs/lib/python3.7/site-packages/splinter/driver/webdriver/init.py", line 16, in
from six import BytesIO
ModuleNotFoundError: No module named 'six'

Sorry about the formatting, kinda suck at it, and after searching for the error, i found no fix related to irs, and i don't understand what's causing it either. Everything else in my machine works fine, and all the terminal base applications i use run correctly.

Accept "EOF" character as an alternative to "exit"

I think it could be a nice feature to accept an end of file character (e.g. Ctrl + D) to exit the IRC prompt as an alternative to the exit option. When you insert it, it shows this error:

Traceback (most recent call last):
  File "/usr/bin/irs", line 11, in <module>
    load_entry_point('irs==6.3.0', 'console_scripts', 'irs')()
  File "/usr/lib/python3.6/site-packages/irs/cli.py", line 59, in main
    console(ripper)
  File "/usr/lib/python3.6/site-packages/irs/utils.py", line 253, in console
    choice = input("{0}irs{1}>{2} ".format(BBLUE, BGRAY, END))
EOFError

Replace usage of os.rename() to shutil.move()

I think this is in the ripper.py script. But when it moves the files into the new directory, it uses os.rename which can lead to errors when the files are on different mounts. Try using shutil.move() as it takes the same inputs and can move across mounts.

Add verbose option with logging module

Add a --verbose option to output more information on the searching, ripping and encoding process of mp3s. It'd be nice to see a --logging option where we could specify log-level such as info, debug. --verbose could also be set to log-level debug while info messages are copied to standard output and to a log file...all configured in the config file of course.

Feature: Allow selecting youtubevideo to download

Right now irs downloads the video it deems most suitable whenever the user does not specify a specific URL. Sometimes this results in bad videos being selected. Most of the time this happended to me it would have been easy for me to see if the program had output the title/length of the video.

Not sure how feasable this is, but after getting the request and ranking them, it might be a nice idea to output the top X videos (name, length, maybe channel?) and ask the user to pick the one he wants to proceed with.

Probably behind a new flag, as to stay backwards compatible.


Alternatively, if the process should stay noninteractive. It might be a good idea to look at the average length of the top X picks and only select the top one if it is not siginficantly longer/shorter than the rest.

Keep getting error while doing irs --setup

Tried in both Linux and Windows.
Tried in both python2 and python3

Traceback (most recent call last): File "C:\Users\AB\AppData\Local\Programs\Python\Python37\Scripts\irs-script.py", line 11, in <module> load_entry_point('irs==7.0.2', 'console_scripts', 'irs')() File "c:\users\ab\appdata\local\programs\python\python37\lib\site-packages\irs\cli\cli.py", line 40, in main set_it_up() File "c:\users\ab\appdata\local\programs\python\python37\lib\site-packages\irs\install\setup.py", line 13, in set_it_up bin_path = os.path.join(conf_path, "bin") File "c:\users\ab\appdata\local\programs\python\python37\lib\ntpath.py", line 76, in join path = os.fspath(path) TypeError: expected str, bytes or os.PathLike object, not NoneType

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.