XFileSharing Pro - mp3 preview problems

Message
Author
Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

mp3 preview problems

#1 Postby Arthur » Dec 05, 2009 11:46 pm

I have 3 problems with mp3 preview:

1. When I upload a mp3 file over 10mb the preview and song details don't show up. (It only lets me download)

2. How can I make it so when uploading a mp3 file that has the key ' it will change it to _ or something. When a mp3 file has the ' it wont preview anymore. (It only lets me download)

3. When using the software to upload mp3 file with the & or ' it wont preview anymore. (It only lets me download)

Help?
Last edited by Arthur on Dec 06, 2009 12:00 am, edited 1 time in total.

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#2 Postby komi » Dec 05, 2009 11:51 pm

If you are using 1.5:

In /cgi-bin/index.cgi find:

Code: Select all

   if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && $file->{file_size}<1048576*10 && !$file->{message})
   {
      my $res = $ses->api($file->{srv_cgi_url},
                          {
                           op           => 'gen_link',
                           file_id      => $file->{file_real_id}||$file->{file_id},
                           file_code    => $file->{file_real},
                           file_name    => $file->{file_name},
                           fs_key       => $file->{srv_key},
                           ip           => $ses->getIP });
      my ($ddcode) = $res=~/^OK:(.+)$/;
      $file->{song_url} = "$file->{srv_htdocs_url}/$ddcode/$file->{file_name}";
   }
and replace with:

Code: Select all

   if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && !$file->{message})
   {
      my $res = $ses->api($file->{srv_cgi_url},
                          {
                           op           => 'gen_link',
                           file_id      => $file->{file_real_id}||$file->{file_id},
                           file_code    => $file->{file_real},
                           file_name    => 'preview.mp3',
                           fs_key       => $file->{srv_key},
                           ip           => $ses->getIP });
      my ($ddcode) = $res=~/^OK:(.+)$/;
      $file->{song_url} = "$file->{srv_htdocs_url}/$ddcode/preview.mp3";
   }
That should help you out ;)

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#3 Postby Arthur » Dec 05, 2009 11:54 pm

im using 1.6 is it still the same?

I have this:

Code: Select all

   if($c->{mp3_mod} && $file->{file_name}=~/\.mp3$/i && $file->{file_size}<1048576*10 && !$file->{message})
   {
      DownloadTrack($file) if $c->{mp3_mod_no_download};
      $file->{song_url} = DownloadGenLink($file,"$file->{file_code}.mp3");
      (undef,$file->{mp3_secs},$file->{mp3_bitrate},$file->{mp3_freq},$file->{mp3_artist},$file->{mp3_title},$file->{mp3_album},$file->{mp3_year}) = split(/\|/,$file->{file_spec}) if $file->{file_spec}=~/^A\|/;
      $file->{no_link}=1 if $c->{mp3_mod_no_download};
      $ses->{meta_keywords}.=", $file->{mp3_artist}" if $file->{mp3_artist};
      $ses->{meta_keywords}.=", $file->{mp3_title}" if $file->{mp3_title};
      $ses->{meta_keywords}.=", $file->{mp3_album}" if $file->{mp3_album};
   }

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#4 Postby komi » Dec 06, 2009 12:01 am

To resolve the filesize problem, simply remove:

Code: Select all

&& $file->{file_size}<1048576*10
The filename problem should be fixed already in 1.6

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#5 Postby Arthur » Dec 06, 2009 12:10 am

k that fixed it. Thnx

Now the other question is when I upload mp3 files with the key ' it wont show the preview instead it says "This text will be replaced"

How can I fix this? Maybe a solution where unrecognized keys to be replaced with _ so it will show the preview?

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#6 Postby komi » Dec 06, 2009 12:14 am

Arthur wrote:k that fixed it. Thnx

Now the other question is when I upload mp3 files with the key ' it wont show the preview instead it says "This text will be replaced"

How can I fix this? Maybe a solution where unrecognized keys to be replaced with _ so it will show the preview?
Well, as I said it should be fixed already. Can you give me an example link?

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#7 Postby Arthur » Dec 06, 2009 12:23 am

link
Last edited by Arthur on Dec 06, 2009 12:59 am, edited 1 time in total.

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#8 Postby komi » Dec 06, 2009 12:50 am

As I can see you are using dl.cgi
Try enabling the "Generate direct links" option.

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#9 Postby Arthur » Dec 06, 2009 12:54 am

Okay yes when I enable direct links it seems to work. But I dont want use direct linking..

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#10 Postby komi » Dec 06, 2009 12:56 am

Sorry, I don't know anything about the dl.cgi
Why do you want to use dl.cgi?

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#11 Postby Arthur » Dec 06, 2009 12:58 am

what do you mean? Do I have other options? I bought the script like a week ago so im getting the hang of it still ;)

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#12 Postby komi » Dec 06, 2009 1:06 am

Well, I read multiple times that dl.cgi is only causing high server load.
So you should only use it when you necessarily want to cap download speeds.
PilgrimX182 wrote:Using sending files via script allow you to limit download speed, but generates high server load. It will be able to handle like 30-50 simultaneous downloads and no dl resume. Another download mode called "Direct Links" is able to handle so many users as your web server can handle sending static files. So it's pretty good designed for high load. Script itself can generate some load when browsing through files, etc, but it's peak load so it won't hurt a lot.

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#13 Postby Arthur » Dec 06, 2009 1:09 am

But how do I not use dl.cgi? Just having it with direct links?

komi
Posts: 161
Joined: Nov 27, 2009 12:41 pm

#14 Postby komi » Dec 06, 2009 1:10 am

When "Generate direct links" is checked, you are using direct links instead of dl.cgi

Arthur
Posts: 74
Joined: Dec 04, 2009 12:00 am

#15 Postby Arthur » Dec 06, 2009 1:13 am

oh k but is there a way to do it so it doesnt generate a page with a direct link, instead maybe replace the "create download link" button with jpg button and allow only download?