Extract links from playlists in multiple directories Announcing the arrival of Valued...

Why weren't discrete x86 CPUs ever used in game hardware?

Delete free apps from library

Is openssl rand command cryptographically secure?

Was Kant an Intuitionist about mathematical objects?

Wrapping text with mathclap

Should a wizard buy fine inks every time he want to copy spells into his spellbook?

Why complex landing gears are used instead of simple,reliability and light weight muscle wire or shape memory alloys?

What initially awakened the Balrog?

Why is the change of basis formula counter-intuitive? [See details]

Putting class ranking in CV, but against dept guidelines

What is the difference between a "ranged attack" and a "ranged weapon attack"?

Can you force honesty by using the Speak with Dead and Zone of Truth spells together?

How much damage would a cupful of neutron star matter do to the Earth?

Asymptotics question

Mounting TV on a weird wall that has some material between the drywall and stud

AppleTVs create a chatty alternate WiFi network

"klopfte jemand" or "jemand klopfte"?

Central Vacuuming: Is it worth it, and how does it compare to normal vacuuming?

Why is std::move not [[nodiscard]] in C++20?

Test print coming out spongy

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

Tips to organize LaTeX presentations for a semester

Is there hard evidence that the grant peer review system performs significantly better than random?

How can a team of shapeshifters communicate?



Extract links from playlists in multiple directories



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How can I generate an M3U playlist from the terminal?For Loop Copy Commandgrep command for a text file in multiple directoriesHow to copy files from multiple directories, adding the parent folder's name to the filename?YouTube-dl - autonumber to distinguish between different playlists mentioned in batch-file?How to bulk download videos and rename them simultaneously using youtube-dl?How to automatically create `.m3u` (or other playlist file) for multiple directories supporting multiple file formats?Combining several youtube-dl commands into one scriptyoutube-dl - Download playlists into corresponding directory, and number the videos in the playlistWhy is the current directory in the ls command identified as linked to itself?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















In a directory I have about 80 directories; in each there is a file containing a link to a YouTube playlist which corresponds to the directory name. I simply want to extract the links to the videos that are in each playlist and put them in a file in the corresponding directory.



To extract links from a playlist:



youtube-dl -j --flat-playlist" URL "| jq -r '.id' | sed 's _ ^ _ https: //youtu.be/_'> Lplaylist


The result of this command is assigned to the Lplaylist file.



The URL is contained in a file in each directory. I simply want to replace it with a command that takes the first line of it (I used the command cut but it does not work: youtube-dl -j --flat-playlist <cat playlist | head -n 1| jq -r '.id' | sed 's _ ^ _ https://youtu.be/_'> Lplaylist && sed 's / $ /" /' Lplaylist> temp && sed -e's / ^ / youtube-dl "/ 'temp> file.sh
: /)



My goal is:




  • In each directory labeled by playlist name, take the first line of the file named ** playlist ** that has the same name in all the directories, and run the command to extract the links from the playlist videos.


Thank you so much and I hope that I was not very long.



My last attempt was as follows:



youtube-dl -j --flat-playlist < `cat playlist | head -n 1` | jq -r '.id' | sed 's_^_https://youtu.be/_' > Lplaylist && sed 's/$/"/' Lplaylist > temp && sed -e 's/^/youtube-dl "/' temp > file.sh


(Translated with Google translate. The original text is viewable in the revision history)










share|improve this question









New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

    – user946855
    12 hours ago




















0















In a directory I have about 80 directories; in each there is a file containing a link to a YouTube playlist which corresponds to the directory name. I simply want to extract the links to the videos that are in each playlist and put them in a file in the corresponding directory.



To extract links from a playlist:



youtube-dl -j --flat-playlist" URL "| jq -r '.id' | sed 's _ ^ _ https: //youtu.be/_'> Lplaylist


The result of this command is assigned to the Lplaylist file.



The URL is contained in a file in each directory. I simply want to replace it with a command that takes the first line of it (I used the command cut but it does not work: youtube-dl -j --flat-playlist <cat playlist | head -n 1| jq -r '.id' | sed 's _ ^ _ https://youtu.be/_'> Lplaylist && sed 's / $ /" /' Lplaylist> temp && sed -e's / ^ / youtube-dl "/ 'temp> file.sh
: /)



My goal is:




  • In each directory labeled by playlist name, take the first line of the file named ** playlist ** that has the same name in all the directories, and run the command to extract the links from the playlist videos.


Thank you so much and I hope that I was not very long.



My last attempt was as follows:



youtube-dl -j --flat-playlist < `cat playlist | head -n 1` | jq -r '.id' | sed 's_^_https://youtu.be/_' > Lplaylist && sed 's/$/"/' Lplaylist > temp && sed -e 's/^/youtube-dl "/' temp > file.sh


(Translated with Google translate. The original text is viewable in the revision history)










share|improve this question









New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

    – user946855
    12 hours ago
















0












0








0








In a directory I have about 80 directories; in each there is a file containing a link to a YouTube playlist which corresponds to the directory name. I simply want to extract the links to the videos that are in each playlist and put them in a file in the corresponding directory.



To extract links from a playlist:



youtube-dl -j --flat-playlist" URL "| jq -r '.id' | sed 's _ ^ _ https: //youtu.be/_'> Lplaylist


The result of this command is assigned to the Lplaylist file.



The URL is contained in a file in each directory. I simply want to replace it with a command that takes the first line of it (I used the command cut but it does not work: youtube-dl -j --flat-playlist <cat playlist | head -n 1| jq -r '.id' | sed 's _ ^ _ https://youtu.be/_'> Lplaylist && sed 's / $ /" /' Lplaylist> temp && sed -e's / ^ / youtube-dl "/ 'temp> file.sh
: /)



My goal is:




  • In each directory labeled by playlist name, take the first line of the file named ** playlist ** that has the same name in all the directories, and run the command to extract the links from the playlist videos.


Thank you so much and I hope that I was not very long.



My last attempt was as follows:



youtube-dl -j --flat-playlist < `cat playlist | head -n 1` | jq -r '.id' | sed 's_^_https://youtu.be/_' > Lplaylist && sed 's/$/"/' Lplaylist > temp && sed -e 's/^/youtube-dl "/' temp > file.sh


(Translated with Google translate. The original text is viewable in the revision history)










share|improve this question









New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












In a directory I have about 80 directories; in each there is a file containing a link to a YouTube playlist which corresponds to the directory name. I simply want to extract the links to the videos that are in each playlist and put them in a file in the corresponding directory.



To extract links from a playlist:



youtube-dl -j --flat-playlist" URL "| jq -r '.id' | sed 's _ ^ _ https: //youtu.be/_'> Lplaylist


The result of this command is assigned to the Lplaylist file.



The URL is contained in a file in each directory. I simply want to replace it with a command that takes the first line of it (I used the command cut but it does not work: youtube-dl -j --flat-playlist <cat playlist | head -n 1| jq -r '.id' | sed 's _ ^ _ https://youtu.be/_'> Lplaylist && sed 's / $ /" /' Lplaylist> temp && sed -e's / ^ / youtube-dl "/ 'temp> file.sh
: /)



My goal is:




  • In each directory labeled by playlist name, take the first line of the file named ** playlist ** that has the same name in all the directories, and run the command to extract the links from the playlist videos.


Thank you so much and I hope that I was not very long.



My last attempt was as follows:



youtube-dl -j --flat-playlist < `cat playlist | head -n 1` | jq -r '.id' | sed 's_^_https://youtu.be/_' > Lplaylist && sed 's/$/"/' Lplaylist > temp && sed -e 's/^/youtube-dl "/' temp > file.sh


(Translated with Google translate. The original text is viewable in the revision history)







command-line text-processing youtube-dl






share|improve this question









New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 17 mins ago









Zanna

51.5k13141244




51.5k13141244






New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 13 hours ago









user946855user946855

1




1




New contributor




user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user946855 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

    – user946855
    12 hours ago





















  • merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

    – user946855
    12 hours ago



















merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

– user946855
12 hours ago







merci j'ai trouve un solition : for d in ./*/ ; do (cd "$d" && youtube-dl -j --flat-playlist head -1 playlist | jq -r '.id' | sed 's_^_youtube-dl "youtu.be/_' > file && sed 's/$/"/' file > file.sh && rm file); done

– user946855
12 hours ago












0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






user946855 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1135541%2fextract-links-from-playlists-in-multiple-directories%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








user946855 is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















user946855 is a new contributor. Be nice, and check out our Code of Conduct.













user946855 is a new contributor. Be nice, and check out our Code of Conduct.












user946855 is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1135541%2fextract-links-from-playlists-in-multiple-directories%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...