• Welcome to RadioDJ - Free Radio Automation Software Forum. Please log in or sign up.

a RadioDJ Audio File Exporter in PHP

Started by cutmaster, May 14, 2015, 09:12:11 PM

cutmaster

Hi all,

Because I needed to move my RadioDJ to a new fresh server, and wanted to copy only used audio files, who were located in several folders & drives, into the new server in a fresh folder, I decided to quick write this small program.
It is a PHP program, written in a couple of hours, that will create for you folders & subfolders, according to the category & subcategory of all your audio tracks, and copy audio files to it.
(so you'll just have to export/import your database and ask the utility of Radio DJ to relocate all files ;-) )
It looks like this :
https://www.dropbox.com/s/8fl68gy9wjfw5wr/RadioDJ_FileCopier_Sample_For_Forum.png?dl=0
And the resulted created folders will look like this :
https://www.dropbox.com/s/2djsvqmascavrsi/RadioDJ_FileCopier_Result.png?dl=0

The PHP file is included...

Hope it will help ;-)
Bests,
CutMaster.

--- EDIT: April 23, 2017 ---

I've attached a new version of this code because I've tried again migrating my Radio to a virtual server.
It appears that on some installation, the copy instruction will not work... So I've added an option that will create the lines to be included to a .bat file :
In Copy Method, select "Create .bat file instructions"...
Then in the next screen, you will see a lot of line showing the audio files found, and the instructions for the .bat files will be after, into a black background that looks like the CMD window. Just copy all those lines, create a .bat file, paste the lines... Save... execute... That's it ;-)

Enjoy guys...

PS: For those who are interested by the installation of Radio DJ on a virtual Windows Server, take a look at my last post here : http://www.radiodj.ro/community/index.php?topic=9915.msg57116#msg57116

[attachment deleted by admin]
The Revival of WOW FM with Radio DJ

http://www.cloudrad.io/cutmaster

Best Dance Music from 80's, 90's to today

TQ

I like that .... A Lot!  :ok:

Thanks for sharing.

TQ
A problem is only a problem if you can't find the solution.

Chaos Radio!

HOLY balls of FIRE! that is amazing..... :hihi:

Great job and thanks a ton!
Chaos Radio! - True Punk Radio for True Punk Rockers!
Over 100,000 songs in the music vault from all over the globe! Proud RadioDJ user since 2014.

https://chaosradio.info

Filip83

#3
OMG, man this is so awesome! <3

I tested it. It did most of the copying nicely but it came up with some errors tho...

4x
Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in D:\xampp\htdocs\radiodj\radiodj_song_export.php on line 137

quite a few
! 88 - ERROR (copy(D:\mp3\2013\1304\Ess?y - Lyla.mp3): failed to open stream: File exists) FROM D:\mp3\2013\1304\Ess?y - Lyla.mp3

quite a few
! 610 - ERROR (copy(D:\mp3\2001\Stereo Mc?s - Ultimate Collection (2001)\01 Stereo Mc's - Deep, Down & Dirty.mp3): failed to open stream: No such file or directory) FROM D:\mp3\2001\Stereo Mc?s - Ultimate Collection (2001)\01 Stereo Mc's - Deep, Down & Dirty.mp3

The last two I guess its a file name problem. I should probably rename them.

The whole process takes quite a long time. Is there any way to know when the operation is complete? How can I tell?

Well all in all props to you CutMaster! I sure wish there would be some kind of tool like this built into Radio Dj. :)
www.diskonektedmusic.com
www.soundcloud.com/diskonekted

Capt_Fuzzy

Steve 'Capt Fuzzy' Wade
Proud & Satisfied "Long-term" RadioDJ User
(Currently making the transition to v2)

WVRR - Ridgerunners Radio
The best mix of your favorites!

baba

Proud user of RadioDJ Free Radio Automation Software.
========================================

http://babaganousha.net
Psytrance & Goa 24/7 - Stream Your Dream