Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
<?xml version="1.0" encoding="utf-8"?><playlist version="1" xmlns:jwplayer="http://developer.longtailvideo.com/"><trackList> <track> <title><![CDATA[V́ Một Người Ra Đi]]></title> <creator><![CDATA[Ưng Hoàng Phúc]]></creator> <location><![CDATA[http://stream31.gonct.info/d1662f31a7693fbf14f8f697ce5795ba/4f88d04d/NhacCuaTui123/Vi Mot Nguoi Ra di - Ung Hoang Phuc [NCT 21634274224197812500].mp3]]></location> <info><![CDATA[http://www.nhaccuatui.com/nghe?M=PJNGXDuPk0]]></info> <image><![CDATA[http://static.nhaccuatui.com/generals/logo-player.jpg]]></image> <jwplayer:adv.enable>true</jwplayer:adv.enable> <jwplayer:adv.link><![CDATA[http://www.nhaccuatui.com/clickqc/wtfpwnghn/wefdkmgois]]></jwplayer:adv.link> <jwplayer:adv.file><![CDATA[http://stc.nct.nixcdn.com/imgqc/2012/04/vfresh_plinner_0404-634691279827076250.swf?bid=wtfpwnghn&skey=wefdkmgois&view=yes]]></jwplayer:adv.file> </track></trackList><trackList> <track> <title><![CDATA[Gọi Tên Em Trong Đêm]]></title> <creator><![CDATA[The Men]]></creator> <location><![CDATA[http://stream42.gonct.info/3902a50be3234d3ed4077a44f2f3bc16/4f88d04d/NhacCuaTui184/Goi Ten Em Trong dem - The Men [NCT 586345336925975812508].mp3]]></location> <info><![CDATA[http://www.nhaccuatui.com/nghe?M=RrJkLmWoVs]]></info> <image><![CDATA[http://static.nhaccuatui.com/generals/logo-player.jpg]]></image> <jwplayer:adv.enable>true</jwplayer:adv.enable> <jwplayer:adv.link><![CDATA[http://www.nhaccuatui.com/clickqc/wtfptojaw/wefdkmgois]]></jwplayer:adv.link> <jwplayer:adv.file><![CDATA[http://stc.nct.nixcdn.com/imgqc/2012/04/h&s_plinner_1302_final-634693320016533750.swf?bid=wtfptojaw&skey=wefdkmgois&view=yes]]></jwplayer:adv.file> </track></trackList><trackList> <track> <title><![CDATA[Nắng Có C̣n Xuân]]></title> <creator><![CDATA[ Nhóm Mặt Trời]]></creator> <location><![CDATA[http://stream62.gonct.info/557114bb0d7c1d2f88fca23f70dad7c2/4f88d04d/NhacCuaTui033/Nang co con xuan - Nhom Mat Troi [NCT 4564256566].mp3]]></location> <info><![CDATA[http://www.nhaccuatui.com/nghe?M=dFpjf69OL0]]></info> <image><![CDATA[http://static.nhaccuatui.com/generals/logo-player.jpg]]></image> <jwplayer:adv.enable>true</jwplayer:adv.enable> <jwplayer:adv.link><![CDATA[http://www.nhaccuatui.com/clickqc/wtfpezpyb/wefdkmgois]]></jwplayer:adv.link> <jwplayer:adv.file><![CDATA[http://stc.nct.nixcdn.com/imgqc/2012/04/vaioe_300x250_nhacucatui_phase2-634695633595440000.swf?bid=wtfpezpyb&skey=wefdkmgois&view=yes]]></jwplayer:adv.file> </track></trackList><trackList> <track> <title><![CDATA[Trái Tim Không Ngủ Yên]]></title> <creator><![CDATA[Mỹ Linh, Bằng Kiều]]></creator>
And i need all strings like:
Code:
http://stream62.gonct.info/557114bb0d7c1d2f88fca23f70dad7c2/4f88d04d/NhacCuaTui033/Nang co con xuan - Nhom Mat Troi [NCT 4564256566].mp3
Is you xml string (the first one) all on one line or multiple lines? XML tags are normally on separate line. This is important on how the strings you want are extracted. Could you post the schema as it is in the file.
The best way to handle xml documents is to use an actual xml parser. I suggest you check out xmlstarlet, or a language like perl that has an xml module available.
Trying to do such work with something like awk or sed is likely to be much trickier to get working right. They just aren't designed for handling such data schemas.
Thank all my friends. I was rewrote new script for downloading.
However, i have new question after downloaded file: move/rename multi file
Original file name:
Quote:
Cho Nguoi Tinh Nho - Tuan Vu [NCT 48634443728911412500_128].mp3
Nang Chieu - The Son [NCT 46633943472496991250].mp3
Chot thay dem buon - Chu Bin [NCT 77634000197958750000].mp3
To new name:
Quote:
Cho Nguoi Tinh Nho - Tuan Vu.mp3
Nang Chieu - The Son.mp3
Chot thay dem buon - Chu Bin.mp3
I have list link in file list.txt
Contents in list
Code:
http://site/com/Cho Nguoi Tinh Nho - Tuan Vu [NCT 48634443728911412500_128].mp3
http://site/com/Nang Chieu - The Son [NCT 46633943472496991250].mp3
http://site/com/Chot thay dem buon - Chu Bin [NCT 77634000197958750000].mp3
I want after downloaded, file will be storage in /path/file/saved/ and renamed to
Code:
Cho Nguoi Tinh Nho - Tuan Vu.mp3
Nang Chieu - The Son.mp3
Chot thay dem buon - Chu Bin.mp3
And my code
Code:
cat list.txt | while read url; do wget -P /path/file/saved/ --continue "${url}"; done
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.