Python Magnetic link Finder

Source: Internet
Author: User

API Author's original: http://blog.163.com/lixiangqiu_9202/blog/static/535750372014370156424/

The first idea I saw after this API was to write a gadget in Python.

1 ImportRequests2 ImportJSON3 ImportOS4 ImportCodecs5 ImportSYS6 7Sys.setrecursionlimit (1000000)8 9Os.chdir ("yourmagnets")Ten  One  AUrl=r'https://brisk.eu.org/api/magnet.php?' -  -Q=input ("input what want:") the  -n=0 -  -  while(n<=4): +str1=str (n) -url2=url+"q="+q+"&n="+str1; +  Ares=requests.get (URL2) atCont=res.content.decode ('Utf-8') -Tar=json.loads (cont) -  -F=codecs.open ("Magnet"+str1+". txt",'WB','Utf-8') -  -      forIinchRange (10): inF.writelines (tar[i]["title"]+'\ r \ n') -F.writelines (tar[i]["Magnet"]+'\ r \ n') to  +N=n+1 -      the  *  $ Panax Notoginseng  -     

The 7th line is because the py2exe out of the problem to check that the recursion is too deep add a This statement results also useless later did not bother to delete

Line 9th understand mkdir () chdir () and the Shutil module can delete the entire folder and all the files inside the Rmtree ()

Line 26th codecs module for processing files

The 30th line of Hell to change the line must be + ' \ r \ n ' my grass ' \ n ' not yet, special.

Finally, the Pyinstaller is turned into an EXE file.

Open the CMD CD to the folder where the file is located

Enter Pyinstaller xxxx.py return.

100 times times stronger than Py2exe!!! 艹

Python Magnetic link Finder

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.