![]() |
PCDVD¼Æ¦ì¬ì§Þ°Q½×°Ï
(https://www.pcdvd.com.tw/index.php)
- ¤C¼L¤K¦Þ²§¨¥°ó
(https://www.pcdvd.com.tw/forumdisplay.php?f=12)
- - ¦³¤H¦b¥ÎLINUX¶Ü??
(https://www.pcdvd.com.tw/showthread.php?t=1013898)
|
---|
§Ú¥Î³Ì²Âªº¤èªk¡A½Æ»s¨ì notepad++ ¦s¦¨¤å¦rÀÉ¡A¦A©ñ¦^¨ìdebian ¤¤ ¡G
root@bananas /baidu # ls -l total 1464 -rw-r--r-- 1 root root 955534 Sep 29 14:25 bypy.bak -rw-r--r-- 1 root root 202545 Sep 27 17:27 bypygui.pyw -rw-r--r-- 1 root root 91444 Sep 29 14:34 bypy.py -rw-r--r-- 1 root root 171601 Sep 27 17:28 LICENSE -rw-r--r-- 1 root root 33478 Sep 27 17:27 README.md -rw-r--r-- 1 root root 30299 Sep 27 17:26 setup.py root@bananas /baidu # python bypy.py File "bypy.py", line 54 sysenc = SystemEncoding.upper() ^ IndentationError: expected an indented block 1 root@bananas /baidu # bypy.bak ¬Owget ¤U¨ÓªºÀɮסAbypy.py ¬O³Ì²Âªº¤èªk°µ¥X¨Óªº¡Aµ²ªGÁÙ¬O¥d¦b²Ä54¦æ¡C |
¤Þ¥Î:
¥N½X:
-rw-r--r-- 1 jiunyu jiunyu 95280 Sep 29 14:17 bypy.py [jiunyu:/tmp] $ sha1sum bypy.py 596616b696ba0303b2f7deaef18f20bb67738791 bypy.py §Ú¤W¶Çªº bypy.py ¤j¤p¬° 95280 byte (95.28KB)¡A¦Ó¥B¥i¥H¶]»¡... ¥N½X:
[jiunyu:/tmp] $ python bypy.py Fail to import the 'requests' library You need to install the 'requests' python library You can install it by running 'pip install requests' Traceback (most recent call last): File "bypy.py", line 214, in <module> import requests ImportError: No module named requests ¦]¬°§Ú¨S¸Ë requests library¡A©Ò¥H¶]¨ì 214 ¦æ´N°±¤F |
¤Þ¥Î:
½Ð°Ý§Aªºpython ª©¥»¬O¦h¤Ö? |
¥N½X:
[jiunyu:/tmp] $ python --version Python 2.7.3 ¤ñ§A¤@¨Ç ¸Õ¸Õ§ÚªºÀÉ®×§a¡A¥Î½Æ»sªº¦³®É·|¦³¨Ç²ö©ú¨ä§®ªº°ÝÃD ======================================== n¥hĵ§½¸ò»F¨ÆªÌ½Í¨®º×©M¸Ñ¤F¡A¯¬§A¦n¹B~ |
¤Þ¥Î:
¤S«·s¤U¸ü¸Õ¤F§AªºÀɮסA´N¥i¥H¥¿±`°õ¦æ¨ì»Ýn¸ê®Æ®w¨º¦æ¤F¡AÁÂÁ¡C µ²ªG»Ýnªºpip ¤Sµo¥Í¤U±ªM¨ã¤F root@bananas /baidu # python get-pip.py --no-index --find-links=/local/copies Ignoring indexes: https://pypi.python.org/simple/ Cleaning up... Exception: Traceback (most recent call last): File "/tmp/tmpsStuYZ/pip.zip/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/tmp/tmpsStuYZ/pip.zip/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl e=self.bundle) File "/tmp/tmpsStuYZ/pip.zip/pip/req.py", line 1096, in prepare_files req_to_install, self.upgrade) File "/tmp/tmpsStuYZ/pip.zip/pip/index.py", line 252, in find_requirement for page in self._get_pages(locations, req): File "/tmp/tmpsStuYZ/pip.zip/pip/index.py", line 387, in _get_pages page = self._get_page(location, req) File "/tmp/tmpsStuYZ/pip.zip/pip/index.py", line 568, in _get_page session=self.session, File "/tmp/tmpsStuYZ/pip.zip/pip/index.py", line 670, in get_page resp = session.get(url, headers={"Accept": "text/html"}) File "/tmp/tmpsStuYZ/pip.zip/pip/_vendor/requests/sessions.py", line 468, in g et return self.request('GET', url, **kwargs) File "/tmp/tmpsStuYZ/pip.zip/pip/download.py", line 237, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/tmp/tmpsStuYZ/pip.zip/pip/_vendor/requests/sessions.py", line 422, in r equest prep = self.prepare_request(req) File "/tmp/tmpsStuYZ/pip.zip/pip/_vendor/requests/sessions.py", line 360, in p repare_request hooks=merge_hooks(request.hooks, self.hooks), File "/tmp/tmpsStuYZ/pip.zip/pip/_vendor/requests/models.py", line 294, in pre pare self.prepare_url(url, params) File "/tmp/tmpsStuYZ/pip.zip/pip/_vendor/requests/models.py", line 345, in pre pare_url "Perhaps you meant http://{0}?".format(url)) MissingSchema: Invalid URL u'/local/copies': No schema supplied. Perhaps you mea nt http:///local/copies? Storing debug log for failure in /root/.pip/pip.log 2 root@bananas /baidu # python get-pip.py --no-index --find-links=/local/copies Ignoring indexes: https://pypi.python.org/simple/ Cleaning up... Exception: Traceback (most recent call last): File "/tmp/tmpjBob3T/pip.zip/pip/basecommand.py", line 122, in main status = self.run(options, args) File "/tmp/tmpjBob3T/pip.zip/pip/commands/install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl e=self.bundle) File "/tmp/tmpjBob3T/pip.zip/pip/req.py", line 1096, in prepare_files req_to_install, self.upgrade) File "/tmp/tmpjBob3T/pip.zip/pip/index.py", line 252, in find_requirement for page in self._get_pages(locations, req): File "/tmp/tmpjBob3T/pip.zip/pip/index.py", line 387, in _get_pages page = self._get_page(location, req) File "/tmp/tmpjBob3T/pip.zip/pip/index.py", line 568, in _get_page session=self.session, File "/tmp/tmpjBob3T/pip.zip/pip/index.py", line 670, in get_page resp = session.get(url, headers={"Accept": "text/html"}) File "/tmp/tmpjBob3T/pip.zip/pip/_vendor/requests/sessions.py", line 468, in g et return self.request('GET', url, **kwargs) File "/tmp/tmpjBob3T/pip.zip/pip/download.py", line 237, in request return super(PipSession, self).request(method, url, *args, **kwargs) File "/tmp/tmpjBob3T/pip.zip/pip/_vendor/requests/sessions.py", line 422, in r equest prep = self.prepare_request(req) File "/tmp/tmpjBob3T/pip.zip/pip/_vendor/requests/sessions.py", line 360, in p repare_request hooks=merge_hooks(request.hooks, self.hooks), File "/tmp/tmpjBob3T/pip.zip/pip/_vendor/requests/models.py", line 294, in pre pare self.prepare_url(url, params) File "/tmp/tmpjBob3T/pip.zip/pip/_vendor/requests/models.py", line 345, in pre pare_url "Perhaps you meant http://{0}?".format(url)) MissingSchema: Invalid URL u'/local/copies': No schema supplied. Perhaps you mea nt http:///local/copies? Storing debug log for failure in /root/.pip/pip.log |
ÁÂÁ¦U¦ìªº¤j¤OÀ°¦£¡A²×©ó¸Ñ¨M¤F¡C
root@bananas /baidu # python bypy.py Token file: '/root/.bypy.json' Hash Cache file: '/root/.bypy.pickle' App root path at Baidu Yun '/apps/bypy' sys.stdin.encoding = UTF-8 sys.stdout.encoding = UTF-8 ---- usage: bypy.py [-h] [--TESTRUN] [--PROFILE] [-V] [-d] [-v] [-r RETRY] [-q QUIT] [-t TIMEOUT] [-s SLICE] [--chunk CHUNK] [-e] [-f] [-l LISTFILE] [--resume-download RESUMEDL] [--include-regex INCREGEX] [--on-dup ONDUP] [--no-symlink] [-c] [command [command ...]] bypy -- Python client for Baidu Yun Copyright 2013 Hou Tianze (GitHub: houtianze, Twitter: @ibic, G+: +TianzeHou) Licensed under the GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt bypy is a Baidu Yun client written in Python (2.7). (NOTE: You need to install the 'requests' library by running 'pip install requests') It offers some file operations like: list, download, upload, syncup, syncdown, etc. The main purpose is to utilize Baidu Yun in Linux environment (e.g. Raspberry Pi) It uses a server for OAuth authorization, to conceal the Application's Secret Key. Alternatively, you can create your own App at Baidu and replace the 'ApiKey' and 'SecretKey' with your copies, and then, change 'ServerAuth' to 'False' positional arguments: command operations (quota / list) optional arguments: -h, --help show this help message and exit --TESTRUN Perform python doctest [default: False] --PROFILE Profile the code [default: False] -V, --version show program's version number and exit -d, --debug enable debugging & logging [default: 0] -v, --verbose set verbosity level [default: 0] -r RETRY, --retry RETRY number of retry attempts on network error [default: 5 times] -q QUIT, --quit-when-fail QUIT quit when maximum number of retry failed [default: False] -t TIMEOUT, --timeout TIMEOUT network timeout in seconds [default: 60] -s SLICE, --slice SLICE size of file upload slice (can use '1024', '2k', '3MB', etc) [default: 20 MB] --chunk CHUNK size of file download chunk (can use '1024', '2k', '3MB', etc) [default: 20 MB] -e, --verify Verify upload / download [default : False] -f, --force-hash force file MD5 / CRC32 calculation instead of using cached values [default: False] -l LISTFILE, --list-file LISTFILE input list file (used by some of the commands only [default: None] --resume-download RESUMEDL resume instead of restarting when downloading if local file already exists [default: True] --include-regex INCREGEX regular expression of files to include. if not specified (default), everything is included. for download, the regex applies to the remote files; for upload, the regex applies to the local files. to exclude files, think about your regex, some tips here: https://stackoverflow.com/questions/406230/regular- expression-to-match-string-not-containing-a-word [default: ] --on-dup ONDUP what to do when the same file / folder exists in the destination: 'overwrite', 'skip', 'prompt' [default: overwrite] --no-symlink DON'T follow symbol links when uploading / syncing up [default: True] -c, --clean 1: clean settings (remove the token file) 2: clean settings and hash cache [default: 0] Commands: help command - provide some information for the command cleancache - remove invalid entries from hash cache file combine <remotefile> [md5s] [localfile] - try to create a file at PCS by combining slices, having MD5s specified compare [remotedir] [localdir] - compare the remote direcotry with the local directory copy/cp <from> <to> - copy a file / dir remotely at Baidu Yun delete/remove/rm <remotepath> - delete a file / dir remotely at Baidu Yun downdir <remotedir> [localdir] - download a remote directory (recursively) downfile <remotefile> [localpath] - download a remote file. dumpcache - display file hash cache list/ls [remotepath] [format] [sort] [order] - list the 'remotepath' directory at Baidu PCS listrecycle [start] [limit] - list the recycle contents meta <remotepath> [format] - get information of the given path (dir / file) at Baidu Yun. mkdir <remotedir> - create a directory at Baidu Yun move/mv/rename/ren <from> <to> - move a file / dir remotely at Baidu Yun quota/info - displays the quota information refreshtoken - refresh the access token restore <remotepath> - restore a file from the recycle bin search <keyword> [remotepath] [recursive] - search for a file using keyword at Baidu Yun stream <remotefile> <localpipe> [format] [chunk] - stream a video / audio file converted to M3U format at cloud side, to a pipe. syncdown [remotedir] [localdir] [deletelocal] - sync down from the remote direcotry to the local directory syncup [localdir] [remotedir] [deleteremote] - sync up from the local direcotry to the remote directory upload [localpath] [remotepath] [ondup] - upload a file or directory (recursively) ¥t¥~«e± /etc/hosts.deny ªº°ÝÃD¡A¬dªºµ²ªG¬O§Ṳ́½¥q¥Î¤G½uªºt¸ü¥¿Å¾¹ªºÃö«Y¡A©Ò¥H·|¦³¤GÓIP¡A¦Ó§Ú¥u³]¤@Ó¡A¥Ø«e¤GÓ³£³]ªºµ²ªG´N¨S°ÝÃD¤F¡A¤£¹Lùرªº»yªk¤£¯à¥Î 10.10.10.1/24¡A¥u¯à¥Î 10.10.10.* ¨Ó¨ú¥N¡C |
¤Þ¥Î:
«ØÄ³¸Õ¸Õxubuntu©ÎªÌlubuntu |
¤Þ¥Î:
µwÅé¸û§C¶¥ªº¹q¸£ ¸ËLubuntu·|¤ñUbuntu¨Óªº¶¶ ¤£¹L¤¶±´N¾ë¹ê¨Ç ¤£¹³ubuntu¨º»ò"µØÄR" Lubuntu¥Ø«e¤]¬O14.04 LTSª© http://lubuntu.net/ |
¤Sn¨D§U¦U¦ì¤F¡G
¥Ø«e°õ¦æ¤F¦Ê«×¶³¦P¨B¡A¤U±¬O°õ¦æ¦P¨B«ü¥O¡A¬Ý°_¨Ó¬O¦³¦b¶i¦æ§@·~¡A¦ý¬O§Útest¸ê®Æ§¨¥u©ñ¤F¤@Ó¤pÀɮסA«o¨S¦³¦P¨B¤U¨Ó¡An¦p¦ó¥t¶}¤@Ó SSH ¨Ó¬Ý§@·~±¡§Î¡C 1 root@bananas /baidu # python bypy.py syncdown /test 640 Token file: '/root/.bypy.json' Hash Cache file: '/root/.bypy.pickle' App root path at Baidu Yun '/apps/bypy' #³oùتº¸ô®|¬O«ü§Ún¦b¦Ê«×¶³¶}¤@Ó¬Û¦P¸ô®|¶Ü? sys.stdin.encoding = UTF-8 sys.stdout.encoding = UTF-8 ---- ^CSignal 2 received, Abort #§Ú«ö¤F CTRL+C ¨Ó¤¤Â_§@·~¡A¥¦¥X²{¤F³oÓ°T®§¡A¦ý¬O§Útest¸ê®Æ§¨¥u¦³©ñ¤@ÓÀɮסA«ç»ò·|±µ¦¬¤GÓ? Frame: <frame object at 0xb66959f0> 20 root@bananas /baidu # =========¤À¹j½u========== ³o¦¸§Ú´«¤U¸ü³æÓÀɮתº¤è¦¡¡G 20 root@bananas /baidu # python bypy.py downfile 1.mp4 /640 Token file: '/root/.bypy.json' Hash Cache file: '/root/.bypy.pickle' App root path at Baidu Yun '/apps/bypy' sys.stdin.encoding = UTF-8 sys.stdout.encoding = UTF-8 ---- /usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py:730: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html (This warning will only appear once by default.) InsecureRequestWarning) µ²ªG¥X²{¤F¦p¤Wªº¿ù»~¡A§ÚÃìµ²¨ì¸Óºô¶°õ¦æ python µM«á¥´¤J >>> import ssl ¨Ã¨S¦³¥X²{¥ô¿ù»~°T®§¡Aª½±µ¥X²{ >>> ¡A³oÀ³¸Óªí¥Ü¸ü¤J ssl ¬O¨S°ÝÃDªº¡A¦ý¬O«ç»ò·|¦b¤U¸ü¦Ê«×¶³Àɮ׮ɡA¤S¥X²{«e±ªº¿ù»~? µù¡G§Ú¦³¸ÕµÛ¦b¦Ê«×¶³«Ø¥ß¤@Óappsªº¸ê®Æ§¨¡A¦ý¬O¦Ê«×¶³¤£Åý§Ú«Ø¥ß¡C |
¸g¹L¤@¤Ñªº§V¤O¡AÁÙ¬O¸Ñ¨M¤£¤FSSL ³s½u°ÝÃD¡A¥u¦n±Ä¨ú²Ä¤G¤è®×¡G
https://github.com/ccdarkness/rdownload ³o¬O¹B¦æ¦b node.js ¤U ¦w¸Ë»¡©ú ·íµMn¥ý¦w¸Ënode.js ·Q¤F¸Ñ¦p¦ó¦w¸Ënode.js ½Ð¬Ý³oùØ https://github.com/joyent/node/wiki...package-manager ¥i¥H¥Î sudo ¨º§A´N¥Îsudo ¡A¥H§Ú¬°¨Ò¡A¬O¤£¯à¥Îsudo ¡A©Ò¥H§Ú¤@ª½¥Îroot±b¸¹§@·~¡A¤£¯à¥Îsudo ½Ð§âsudo ¨ú®ø ¥N½X:
sudo apt-get install software-properties-common sudo apt-get update sudo apt-get install -y python-software-properties python g++ make sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs ¦]¬°¥¦¥u·|¤U¸ü¤@Ó¸ê®Æ§¨¤UªºªF¦è¡A¥B¤£¯à«ü©w¸ê®Æ§¨¤U¸ü¡A©Ò¥H½Ð¥ý³Ð¥ß¤@Ó·s±b¸¹¡A¤W¶Ç¤@ÓÀɮסA¦A¥Î§Aªº¤â¾÷µn¿ý¦Ê«×¶³¡A¨Ã¥B¦P¨B¬Û¥U¡A¥¦´Nµ¹§A2TªºªÅ¶¡¡C µn¿ý¶i¤Jºô¶¡A§Ų́ӱҰʡA¥ý½Ð¤U¸ür.js ¨ì§A«ü©wªº¥Ø¿ý¡AµM«á¥´¤J node r.js §ÚªºDebian ¤ñ¸û©_©Ç¡An¥´ nodejs r.js ³o®ÉԦʫ׶³ ¥Ø¿ý apps > rdownload ¤Uªº©Ò¦³¸ê®Æ´N¦Û°Ê¤U¸ü¨ì§A²{¦b¥Ø¿ý¤Uªºrdownload/ ¦pªG§A¤£n©ñ¦b³oùØ¡A¨º´N¦Û¦ænano r.js ¶i¦æ¬ÛÃö¸ô®|×§ï¡C ´ú¸Õµ²ªG root@bananas /baidu # nodejs r.js 200 µn陆¦¨¥\¡I 检¯Á¤å¥ó¦Cªí:/apps/rdownload/ ©Ò¦³¥ô务¤w经§¹¦¨¡I 200 µn陆¦¨¥\¡I 检¯Á¤å¥ó¦Cªí:/apps/rdownload/ ¤U载¤å¥ó:/apps/rdownload/¥Ø«e IP.txt http://nb.baidupcs.com/file/e64f994...1&vuk=-&vbdid=- ¤å¥ó¤U载¦¨¥\:/apps/rdownload/¥Ø«e IP.txt -----¤À¹j½u------- ¥¦·|¦Û°Ê¦P¨B¤U¸ü¡A¤¤¤å§¹¥þ¨S°ÝÃD¡A¤U¸ü³t«×¶Ü? ´N¸ò§A¥Î¹q¸£¦P¨Bµ{¦¡±µªñ¡C |
©Ò¦³ªº®É¶¡§¡¬°GMT +8¡C ²{¦bªº®É¶¡¬O09:21 PM. |
vBulletin Version 3.0.1
powered_by_vbulletin 2025¡C