Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kaimi-io/yandex-music-download.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaimi <kaimi-@users.noreply.github.com>2019-08-30 15:37:55 +0300
committerGitHub <noreply@github.com>2019-08-30 15:37:55 +0300
commit201d2444bfdd4da8c76ad2f99fb6691759938873 (patch)
treecf085f5042641c63baa40ecda72aa5dd2c59e30b
parent996636e7ac2d8cf378f87e152a0a565035f18775 (diff)
parent95173d9e0711d3ae498112d2d1bbb911235fba78 (diff)
Merge pull request #14 from l29ah/links
Add an option to print links to the tracks instead of fetching them
-rwxr-xr-xsrc/ya.pl22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/ya.pl b/src/ya.pl
index f755527..8f54c50 100755
--- a/src/ya.pl
+++ b/src/ya.pl
@@ -191,6 +191,8 @@ my ($opt, $usage) = Getopt::Long::Descriptive::describe_options
['Bitrate 320 is available only when subscription is active'],
['and only via mobile API for now (be sure to specify Authorization header value)'],
[],
+ ['link|l', 'do not fetch, only print links to the tracks'],
+ ['silent|s', 'do not print informational messages'],
['debug', 'print debug info during work'],
['help', 'print usage'],
[],
@@ -385,12 +387,17 @@ if($opt{album} || ($opt{playlist} && $opt{kind}))
next;
}
- fetch_track($track_info_ref);
-
- if($opt{delay} && $track_info_ref != $track_list_info[-1])
+ if($opt{link})
{
- info(INFO, 'Waiting for ' . $opt{delay} . ' seconds');
- sleep $opt{delay};
+ print(get_track_url($track_info_ref->{dir}));
+ } else {
+ fetch_track($track_info_ref);
+
+ if($opt{delay} && $track_info_ref != $track_list_info[-1])
+ {
+ info(INFO, 'Waiting for ' . $opt{delay} . ' seconds');
+ sleep $opt{delay};
+ }
}
}
@@ -1027,6 +1034,11 @@ sub info
{
my ($type, $msg) = @_;
+ if($opt{silent} && $type ne ERROR)
+ {
+ return;
+ }
+
if($type eq DEBUG)
{
return if !$opt{debug};