Repository: streamlink/streamlink

Issue:
Feature request: Personal "channels"
- [ ] This is a bug report.
- [ ] This is a plugin request.
- [x] This is a feature request.
- [ ] I used the search function to find already opened/closed issues or pull requests.

### Description
I've been browsing the information on the configuration pages, but I can't find a way to achieve something I want to do. I would like to have the ability to save streams I frequently watch and reload them with a simpler command, like "streamlink one" for instance. It would save users a lot of time, since longer/weirder links can't be memorized easily and have to be sought out or kept as a bookmark. On lower-spec PCs running Linux, opening a browser and waiting for a bookmark to load can require a lot of time and CPU usage. 

Excuse me if there's already a way of doing this, I was unable to find it.



Discussion:
This could be cool. While we do support https://streamlink.github.io/cli.html#cmdoption-default-stream we don't have any options like this. Let's see what other people think. Maybe there's a way to do this that I haven't used, but I'm not aware of one.
I'd say that this doesn't belong into Streamlink and should be implemented in a wrapper shell script that replaces the input with a previously defined stream url. I know that this is what I usually suggest for those kind of feature requests, but it's not Streamlink's job to be a bookmark manager (or something like that).
If we added a new parameter `--url` (or something) that could be used instead of the usual `URL` argument then you could just use the existing config loading syntax (`@config.cfg`). The config loader uses the same syntax as the main `streamlinkrc` file. Then you would be able to do `streamlink @bookmark.cfg` (with `--url` and `--default-stream`, plus any other options you need.)
@beardypig - I based this on the idea that this would be useful in general, especially if somebody wanted to automate streamlink. Like using IFTTT to lock in on your GPS, send a command to your TV that's linked up with a raspberry pi to start up a twitch stream when you're almost home :)
With this patch:
```diff
diff --git a/src/streamlink_cli/argparser.py b/src/streamlink_cli/argparser.py
index 49e4eaf..14f00a8 100644
--- a/src/streamlink_cli/argparser.py
+++ b/src/streamlink_cli/argparser.py
@@ -467,6 +467,15 @@ output.add_argument(

 stream = parser.add_argument_group("Stream options")
 stream.add_argument(
+    "--url",
+    dest="url_param",
+    metavar="URL",
+    help="""
+    Alternative parameter to specify a URL to attempt to
+    extract streams from.
+    """
+)
+stream.add_argument(
     "--default-stream",
     type=comma_list,
     metavar="STREAM",
diff --git a/src/streamlink_cli/main.py b/src/streamlink_cli/main.py
index dffbfc2..e259381 100644
--- a/src/streamlink_cli/main.py
+++ b/src/streamlink_cli/main.py
@@ -577,6 +577,9 @@ def setup_args(config_files=[]):
     if args.stream:
         args.stream = [stream.lower() for stream in args.stream]

+    if not args.url and args.url_param:
+        args.url = args.url_param
+

 def setup_config_args():
     config_files = []
```

You could create a file `pokerstars.cfg`:
```cfg
url=www.twitch.tv/pokerstars  # almost always online
default-stream=best
```

and load it using
```
streamlink @pokerstars.cfg
```
@beardypig - I'm guessing I'd have to personally place this patch into the code (running on a Windows PC as my main computer, only my travelling laptop is Linux-based), but would it be overwritten during nightly updates?

The idea is elegant enough to work well. If I leave out "default-stream" for quality, I'd have to add the quality after the cfg, correct? I'm guessing there's no easy way to instruct streamlink to always check a subfolder named "channels" for cfg files and load them with a simpler command like I mentioned before.
Correct in both cases, the changes would be overwritten and if you left out `default-stream` you'd have to add it to the command line. 
There is no easy way to have the channels directory, but you could do with a bash/bat script. I'm not super familiar with bat files, but in bash it would be simple:
```bash
# streamlink-channel.sh
#!/bin/bash
CHANNEL_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/streamlink/channels"
cfg_file="${CHANNEL_DIR}/${1}"

streamlink "@$cfg_file"
```
Then it would look in `~/.config/streamlink/channels` for the config files, `streamlink-channel.sh foo` would look for `~/.config/streamlink/channels/foo`.

Resolving patch:
diff --git a/src/streamlink_cli/argparser.py b/src/streamlink_cli/argparser.py
--- a/src/streamlink_cli/argparser.py
+++ b/src/streamlink_cli/argparser.py
@@ -166,6 +166,7 @@ def boolean(value):
     A URL to attempt to extract streams from.
 
     If it's a HTTP URL then "http://" can be omitted.
+    The URL can also be specified using the --url option.
     """
 )
 positional.add_argument(
@@ -466,6 +467,18 @@ def boolean(value):
 )
 
 stream = parser.add_argument_group("Stream options")
+stream.add_argument(
+    "--url",
+    dest="url_param",
+    metavar="URL",
+    help="""
+    A URL to attempt to extract streams from.
+
+    If it's a HTTP URL then "http://" can be omitted.
+
+    This is an alternative to setting the URL using a positional argument.
+    """
+)
 stream.add_argument(
     "--default-stream",
     type=comma_list,
diff --git a/src/streamlink_cli/main.py b/src/streamlink_cli/main.py
--- a/src/streamlink_cli/main.py
+++ b/src/streamlink_cli/main.py
@@ -577,6 +577,9 @@ def setup_args(config_files=[]):
     if args.stream:
         args.stream = [stream.lower() for stream in args.stream]
 
+    if not args.url and args.url_param:
+        args.url = args.url_param
+
 
 def setup_config_args():
     config_files = []


Test patch: