Status
Not open for further replies.

CJ

Active Member
3,788
2009
1,035
0
I upload files all at once so its like 10 stuffs at a time. & 3 different file hosts. I am trying to do is sort this links based on the name of the stuff

Example: I have this links

INPUT
http://RS.com/file1.part01.rar
http://RS.com/file1.part02.rar
http://RS.com/file2.part01.rar
http://RS.com/file2.part02.rar
http://FS.com/file1.part01.rar
http://FS.com/file1.part02.rar
http://FS.com/file2.part01.rar
http://FS.com/file2.part02.rar
http://HF.com/file1.part01.rar
http://HF.com/file1.part02.rar
http://HF.com/file2.part01.rar
http://HF.com/file2.part02.rar

I want this as to be arranged based on the stuff name i.e. file1, file2. The ouput should be like
output
http://RS.com/file1.part01.rar
http://RS.com/file1.part02.rar
http://FS.com/file1.part01.rar
http://FS.com/file1.part02.rar
http://HF.com/file1.part01.rar
http://HF.com/file1.part02.rar

http://RS.com/file2.part01.rar
http://RS.com/file2.part02.rar
http://FS.com/file2.part01.rar
http://FS.com/file2.part02.rar
http://HF.com/file2.part01.rar
http://HF.com/file2.part02.rar

Do u guys have any idea to make this work. I am trying this for some time now. But I failed miserably :P

Note : Please I dont want to sort the links. Sorting is easy & I already have sorted list. I need output in particular format as seen in example. Links of one stuff with diffFilehost at a time. Its not as u guys are thinking.
 
18 comments
^plz dont use ur brain too much. It is dangerous for u. -_-
Please mate need serious reply. This part wastes most of my time.
 
hey,
you need to extract the filename "file1.part01.rar" or "file2.part02.rar" (using last delimiter "/"). Well, now remove the file ext ".rar", ".zip" ... and again check if there is something like "part" in the filename -> remove the file extension again. For some file-hosters you maybe need to remove the "htm" or "html" first [depends i.e. netload.in ].
Okay now you have the filename only, without the file extension and you can compare "file1" != "file2" but "file1" == "file1" ...

i hope this helps =)
 
bash scripting lol :P

Input

[slide]http://cdnpic.com/upload/6ddb85c9.png[/slide]


Output

[slide]http://cdnpic.com/upload/669208c1.png[/slide]

is that what you need ?

one liner..

use linux sort command with number option

sort -n
 
hey,
you need to extract the filename "file1.part01.rar" or "file2.part02.rar" (using last delimiter "/"). Well, now remove the file ext ".rar", ".zip" ... and again check if there is something like "part" in the filename -> remove the file extension again. For some file-hosters you maybe need to remove the "htm" or "html" first [depends i.e. netload.in ].
Okay now you have the filename only, without the file extension and you can compare "file1" != "file2" but "file1" == "file1" ...

i hope this helps =)

Lol do u think I havent tried that. Its not working that way around.

bash scripting lol :P

is that you need ?

one liner..

use linux sort command with number option

sort -n

Lol the part u are showing can be done easily. Just see example of input & output its differnt from what u just said. I need the links of one stuff altogether (with different filehosts mirror)
All part of 1st stuff on RS
All part of 1st stuff on FS
All part of 1st stuff on HF

All part of 2nd stuff on RS
All part of 2nd stuff on FS
All part of 2nd stuff on HF
See example plz

yea desi thts wht he exactly needs :P

What the fuck u think lol. That wasnt i needed. See example >.<
 
Lol do u think I havent tried that. Its not working that way around.

it will work and you will get these two link-blocks you've posted ([EDIT] not yet completely sorted[/EDIT]). After this you have to sort the hoster-names. Maybe you should make a system for different hoster declarations but the same hoster (uploaded.to // ul.to ...) [remove ".www"].
Finally you need to sort the parts, i recommend to use regular expressions i.e.:
Use the second match for getting the part-index
Code:
(7z\.|part|r|[.][0-9])([0-9]+)
not intended for commercial use!
powered by: Mody™ a part of IntelligeN 2009 © 2007-2010 Sebastian Klatte

---
If you understand everything you ll see that you have to do this in 3 steps, in my first post i've give you a hint how you can start...
 
Here:

[slide]http://lulzimg.com/i5/44af2191.png[/slide]

PHP:
<form method="POST" action="" enctype="multipart/form-data">
<textarea name=data cols=50 rows=10></textarea>
<input type=submit name=submit value=go />
</form>

<?php

if (isset($_REQUEST['submit']))
{
	$data = $_POST['data'];
	$data = explode("\n", $data);
	sort($data);
	foreach ($data as $repre)
	{
		echo $repre;
		echo '<br />';
	}

}

?>


EDIT: nvm. I just read the first post closely again and my code fails to address the issue. But I'll leave it here just in case someone wants to use it.
 
Damn guys I need the links of particular stuff on Diff file host togetther than next stuff with all file host & then next & continue

Just see the example. I dont need Sorting of links guys. Thats easy :P
 
V3g3t4 for the rescue >_>

[slide]http://lulzimg.com/i5/8b7975c2.png[/slide]

PHP:
        <?php
        if (isset($_REQUEST['submit'])) {
            $data = $_POST['data'];
            $data = explode("\n", $data);
            sort($data);

            $i=0;
            echo "<br />Input data:<br />";
            foreach ($data as $repre) {
                echo $repre . '<br />';
                $test[$i] = pathinfo(pathinfo($data[$i],PATHINFO_FILENAME),PATHINFO_FILENAME);
                $i++;
            }

            echo "<br />Sorted data:<br />";
            $unique = array_unique($test);
            
            foreach($unique as $v3g){
               if($v3g){
                   foreach($data as $repre)
                       if(strpos($repre,$v3g)) echo $repre."<br />";
               }
               echo "<br />";
            }
        }
        ?>
Thanks to lifetalk for making the form -_-. Hope that helps!

used two pathinfo_filenames just for the lulz! naaah, it's to get the actual filename, use explode if you want.
 
thanks mate relly appreaciated ur work. Let me try if it really works :P

It works with minor problem but its best for me, thanks for saving my 20 mins per day :P lol
 
V3g3t4 for the rescue >_>

[slide][URL][URL][URL]http://lulzimg.com/i5/8b7975c2.png[/URL][/URL][/URL][/slide]

PHP:
        <?php
        if (isset($_REQUEST['submit'])) {
            $data = $_POST['data'];
            $data = explode("\n", $data);
            sort($data);

            $i=0;
            echo "<br />Input data:<br />";
            foreach ($data as $repre) {
                echo $repre . '<br />';
                $test[$i] = pathinfo(pathinfo($data[$i],PATHINFO_FILENAME),PATHINFO_FILENAME);
                $i++;
            }

            echo "<br />Sorted data:<br />";
            $unique = array_unique($test);
            
            foreach($unique as $v3g){
               if($v3g){
                   foreach($data as $repre)
                       if(strpos($repre,$v3g)) echo $repre."<br />";
               }
               echo "<br />";
            }
        }
        ?>
Thanks to lifetalk for making the form -_-. Hope that helps!

used two pathinfo_filenames just for the lulz! naaah, it's to get the actual filename, use explode if you want.

This is brilliant script. But hellshare is not work for this :(
if someone would be so kind and remade it to work well with the HellShare?
Example link:
hellshare.com/my-week-with-marilyn-2011-brrip-xvid-bida-avi/5447996/
 
Ooo, bumping an old topic eh?

If you observe the Hellshare links, the file's ID comes after the filename. You'll have to modify the script accordingly coz at present it sorts the links depending on the filename (i.e. file1, file2 as in the example)
 
Status
Not open for further replies.
Back
Top