النتائج 1 إلى 8 من 8

الموضوع: كيف يقوم سكربت برفع ملف الى مراكز الرفع وسحب رابط التحميل

  1. #1

    كيف يقوم سكربت برفع ملف الى مراكز الرفع وسحب رابط التحميل



    السلام عليكم

    انا اتكلم عن نفس فكرة موقع qooy.com وغيره
    اانا وجدت اسكربت بسيط مكون من 4 صفحات يقوم برفع الملفات الى مراكز الرفع
    هذا مثال عليه >
    كود PHP:
    http://mtrp.net/mr/ 
    حبيت اعرف كيف يتم اخذ بيانات المركز وكيف يتم سحب رابط التحميل منه بعد اكتمال الرفع
    وجدت ان المبرمج استخدم كلاس لكل مركز رفع وفنكوشن خاص للرفع واخر خاص لعملية جلب رابط التحميل
    وهذا سهل الموضوع جدا عليا
    كود PHP:
    <?php
    class Rapidshare 
    {
        var 
    $upURL;
        function 
    getUpURL() 
        {
            
    $rs file_get_contents("http://rapidshare.com");
            
    $rs explode("action=\""$rs);
            
    $rs explode("\""$rs[1]);
            
    $this->upURL $rs[0];
        }
        function 
    getDownloadLink($ret) {
            
    $ret explode("Download Link:</td><td align=right><a href=\""$ret);
            
    $ret explode("\""$ret[1]);
            return 
    $ret[0];
        }
        function 
    upload() 
        {
            global 
    $upfile$file_temporary_location;
            
    $postdata = array();
            
    $postdata['filecontent'] = "@" getcwd() . "/" $file_temporary_location;
            
    $this->getUpURL();
            
            
    $curl curl_init($this->upURL);
            
    curl_setopt($curlCURLOPT_URL$this->upURL);
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_HEADERtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            
            
    $dlLink $this->getDownloadLink($page);
            return 
    strtolower($dlLink);
        }
        
    }

    class 
    Filefactory
    {
        var 
    $upURL;
        
        function 
    getUpURL() 
        {
            
    $ff file_get_contents("http://filefactory.com");
            
    $ff explode("<form id=\"uploader\" action=\""$ff);
            
    $ff explode("\""$ff[1]);
            
    $this->upURL $ff[0];
        }
        
        function 
    getDownloadLink($id)
        {
            global 
    $basefilename;
            return 
    "http://www.filefactory.com/file/" $id "/n/" $basefilename;
        }
        
        function 
    upload() 
        {
            global 
    $upfile$file_temporary_location;
            
    $postdata = array();
            
    $postdata['file'] = "@" getcwd() . "/" $file_temporary_location;
            
    $this->getUpURL();
            
            
    $curl curl_init($this->upURL);
            
    curl_setopt($curlCURLOPT_URL$this->upURL);
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            
            
    $dlLink $this->getDownloadLink($page);
            return 
    strtolower($dlLink);
        }
    }
    class 
    Megashare
    {
        function 
    getDownloadLink($page) {
            
    $page explode("SIZE=\"50\" readonly=\"0\" VALUE=\""$page);
            
    $page explode("\""$page[1]);
            return 
    $page[0];
        }
        function 
    upload() 
        {
            global 
    $upfile$file_temporary_location;
            
    $postdata = array();
            
    $postdata['upfile_0'] = "@" getcwd() . "/" $file_temporary_location;
            
    $postdata['fps'] = "";
            
    $postdata['upload_range'] = "1";
            
    $postdata['emai'] = "Free";
            
            
    $urlUp "http://upload.megashare.com/cgi-bin/uploader.cgi?tmp_sid=".session_name()."&rnd=1";
            
            
    $curl curl_init();
            
    curl_setopt($curlCURLOPT_URL$urlUp);
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            
    $dlLink $this->getDownloadLink($page);
            return 
    strtolower($dlLink);
        }
    }
    class 
    MegaUpload{
        var 
    $upID;
        var 
    $upURL;
        var 
    $SID;
        function 
    getUpURL() {
            
    $page file_get_contents("http://megaupload.com");
            
    $bup $page;
            
    $page explode("ENCTYPE=\"multipart/form-data\" action=\""$page);
            
    $page explode("\""$page[1]);
            
    $this->upURL $page[0];
            
    $page explode("?UPLOAD_IDENTIFIER="$page[0]);
            
    $this->upID $page[1];
            
    $bup explode("name=\"sessionid\" value=\""$bup);
            
    $bup explode("\""$bup[1]);
            
    $this->SID $bup[0];
            
        }
        function 
    getDownloadLink($page) {
            
    $page explode("parent.downloadurl = '"$page);
            
    $page explode("'"$page[1]);
            return 
    strToLower($page[0]);
        }
        function 
    upload() {
            global 
    $file_temporary_location;
            
    $this->getUpURL();
            
    $postdata = array();
            
    $postdata['filecount'] = "";
            
    $postdata['UPLOAD_INDENTIFIER'] = $this->upID;
            
    $postdata['sessionid'] = $this->SID;
            
    $postdata['file'] = "@" getcwd() . "/" $file_temporary_location;
            
    $postdata['message'] = "File upload";
            
            
    $curl curl_init();
            
    curl_setopt($curlCURLOPT_URL$this->upURL);
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            return 
    $this->getDownloadLink($page);
        }
    }
    class 
    loadto{
        var 
    $upURL;
        function 
    getUpURL() {
            
    $page file_get_contents("http://load.to");
            
    $action explode("<form name=\"form_upload\" method=\"post\" enctype=\"multipart/form-data\"  action=\""$page);
            
    $action explode("\""$action[1]);
            
    $this->upURL $action[0];
        }
        function 
    getDownloadLink($page) {
            
    $page explode("<td align=\"left\"><a href=\""$page);
            
    $page explode("\""$page[1]);
            return 
    $page[0];
        }
        function 
    upload() {
            global 
    $file_temporary_location;
            
    $this->getUpURL();
            
    $postdata = array();
            
    $postdata['imbedded_progress_bar'] = "0";
            
    $postdata['upload_range'] = "1";
            
    $postdata['upfile_0'] = "@" getcwd() . "/" $file_temporary_location;
            
    $postdata['submit'] = "Upload";
            
            
    $curl curl_init();
            
    curl_setopt($curlCURLOPT_URL$this->upURL);
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            return 
    $this->getDownloadLink($page);
        }
    }
    class 
    justupit{
        function 
    getDownloadLink($page) {
            
    $page explode("value=\""$page);
            
    $page explode("\""$page[1]);
            return 
    $page[0];
        }
        function 
    upload() {
            global 
    $file_temporary_location;
            
    $postdata = array();
            
    $postdata['filecontent'] = "@" getcwd() . "/" $file_temporary_location;
            
    $postdata['MAX_FILE_SIZE'] = "50000";
            
    $postdata['frontpage'] = "yes";
            
    $postdata['u'] = "Upload File Now";
            
            
    $curl curl_init();
            
    curl_setopt($curlCURLOPT_URL"http://www.justupit.com/upload.php");
            
    curl_setopt($curlCURLOPT_POSTtrue);
            
    curl_setopt($curlCURLOPT_POSTFIELDS$postdata);
            
    curl_setopt($curlCURLOPT_RETURNTRANSFERtrue);
            
    curl_setopt($curlCURLOPT_FOLLOWLOCATIONtrue);
            
    $page curl_exec($curl);
            
    curl_close($curl);
            return 
    $this->getDownloadLink($page);
        }
    }
    function 
    setLinksBox($text) {
        echo 
    "<script>parent.document.getElementById('links').innerHTML = ' $text '; </script>";
    }
        
    $upload = new upload;
        
        
    $Rapidshare = new Rapidshare;
        
    $Filefactory = new Filefactory;
        
    $Megashare = new Megashare;
        
    $MegaUpload = new MegaUpload;
        
    $loadto = new loadto;
        
    $justupit = new justupit;
    ?>
    بس للاسف حاولت بكل الطرق انى اضيف مركز بنفس الطريقة اللى منفذها عن طريق اخذ المعلومات من سورس صفحة المركز وفشلت

    فهل حد يقدر يفهمنى ازاى بيتم اضافة مركز ؟
    شكرا





    __________________
    - حسابى على فيسبوك --> هنا
    - لطلبات تعريب السكربتات والقوالب & التعديلات البرمجية ---> MtRp@live.com


  2. #2


    حينما ترفع ملف علي المواقع هذه فبعد الأنتهاء تنتقل لصفحة فيها رابط التحميل
    هو يقوم بمكتبة curl بتعبئة مخزن الرفع وارسال العمل بواسطة curl ك post طبعا علي رابط الرفع اللي يكون موجود في رأس الform للصفحة
    بعد ذلك يستورد الصفحة التي تصل في النهاية والتي بالطبع ستظهر حينما ينتهي الرفع ثم يأخذ محتواها ويجلب منه رابط التحميل واللي يكون موجود دائما في مكان محدد في السورس كود للصفحة الذي تلقاه بعد ارسال الملف





    __________________
    السيف أصدق أنباء من الكتب

  3. #3
    عضو فعال
    تاريخ التسجيل
    Jul 2008
    المشاركات
    1,109


    ممكن رابط تحميل هذا السكربت ؟؟؟؟





    __________________
    ســـــــبحان الله وبـــــــــحمده *سبـــــــــــحان الله العظيم
    لطلب البرمجة فقط
    helal-egypt@hotmail.com

  4. #4


    حينما ترفع ملف علي المواقع هذه فبعد الأنتهاء تنتقل لصفحة فيها رابط التحميل
    هو يقوم بمكتبة curl بتعبئة مخزن الرفع وارسال العمل بواسطة curl ك post طبعا علي رابط الرفع اللي يكون موجود في رأس الform للصفحة
    بعد ذلك يستورد الصفحة التي تصل في النهاية والتي بالطبع ستظهر حينما ينتهي الرفع ثم يأخذ محتواها ويجلب منه رابط التحميل واللي يكون موجود دائما في مكان محدد في السورس كود للصفحة الذي تلقاه بعد ارسال الملف
    كلام جميل
    بس شوف الفرق ما بين كلاس موقع loadto
    وكلاس justupit
    هتلاقى فى الكلاس الاول انه حط الفورم وقام بتقطيعه عن طريق explode
    لكن فى الكلاس التانى لم يدمجه مع انه بالطبع موجود فى سورس الموقع
    فاعتقد الموضوع اصعب شوية
    ممكن رابط تحميل هذا السكربت ؟؟؟؟
    الاسكربت فى المرفقات
    بس على فكرة مش بيشتغل على localhost





    الملفات المرفقة الملفات المرفقة
    • نوع الملف: zip 123.zip‏ (157.8 كيلوبايت, 258 مشاهدات)
    __________________
    - حسابى على فيسبوك --> هنا
    - لطلبات تعريب السكربتات والقوالب & التعديلات البرمجية ---> MtRp@live.com

  5. #5


    هو يستخدم explode لمحتوي الصفحة اللي يجلبه
    بأختصار يريد الوصول للرابط من السوس بدون استخدام تعابير قياسية و preg_match
    لهذا فهو يقرب للرابط حتي يصل له

    لكن كلها نفس الفكرة وحسب محتوي الصفحة ومكان وجود الرابط ومدي تكرار ما حول الرابط في الصفحة حتي لا يجلب رابط خاطئ

    ويبدوا لي ان موقع justupit يعرض الرابط مع زر او شئ في حقل value بعكس الأولي يعرضها بشكل طبيعي <a></a>





    __________________
    السيف أصدق أنباء من الكتب

  6. #6
    عضو فعال
    تاريخ التسجيل
    Feb 2008
    المشاركات
    1,759


    بعد اذنك يا مطربنا
    سؤال بنفس الموضوع
    لدي ملف وليكن مثلا http://sitename.com/file.zip
    واريد ان اجعل الرابيد شير يقوم بتحميل وجلب الرابط باستخدام نفس الكلاسات وليس عن طريق رفع الملف من الجهاز

    كيف يمكن ذلك ياترى؟





    __________________
    FaceBook Application Developer
    تعلم برمجة سكريبت جلب المحتوى خطوة بخطوة
    مشروعى داخل معرض الاتصالات
    لمراسلتي إضغط هنا
    سبحان الله وبحمده سبحان الله العظيم

  7. #7
    عضو فعال
    تاريخ التسجيل
    Jul 2008
    المشاركات
    1,109


    اخي عشان السكربت يشتغل علي السيرفر المحلي شوف الشرح ده

    [

    بتوفيق ان شاء الله





    __________________
    ســـــــبحان الله وبـــــــــحمده *سبـــــــــــحان الله العظيم
    لطلب البرمجة فقط
    helal-egypt@hotmail.com

  8. #8


    في الرابد شير يقوم بالبحث في السورس على العبارة التالية
    كود HTML:
    Download Link:</td><td align=right><a href=\"

    و ينسخ ما بعدها ، أي الرابط ، إذن هل يمكن تجاوز هذه الطريقة ؟

    لأني أواجه نفس المشكل من أحد السكريبتات التي اعمل عليها الان ، و أحتاج لطريقة لتظليل ال(عدو)

    فهل سينجح إذا وضعت عدة عبارات مشابهة في السورس ؟



    تحديث :
    http://www.swalif.net/softs/swalif45...6/#post1946131






    التعديل الأخير تم بواسطة خالد الحضري ; 06-11-2009 الساعة 08:20 AM





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض