|
Another Filtering Proxy
|
|
May. 28, 2015, 04:26 AM
(This post was last modified: May. 28, 2015 07:42 AM by cattleyavns.)
Post: #17
|
|||
|
|||
|
RE: Another Filtering Proxy
Great job! I think we should rewrite self.headers.update too, I'm trying to do that now. Urllib3 headers feature is not good at least at this time, I think we should depart the whole header feature from them I use built-in as much as possible.
Can you tell me how to get this line to URLFilter.py and modify it as I want: Code: headers = urllib3._collections.HTTPHeaderDict()I'm adding proxy feature to AFProxy using proxy_from_url, but I want to patch above problem by set headers = self.headers (req.headers in URLFilter.py) I'm learning Python but I'm having a really tough question about "threading", threading with Python is not easy at all.. I would like to ask you some question and hope you will help me: - In threading, how can we download a big file in parts but join it one by one instead wait them all finish and then join. Code, save as .py and then run it. Code: import os, requestsWhat I want is: - For example we have a big file with 100MB file size - We will split that file with Content-Length - We will use "threading" module to download that file in parts to ensure we have as fast as possible download speed instead download one by one without threading then join part. - But problem is with threading "join()", we cannot stream file or write file to disk instantly like Free Download Manager/Flashget software because "join()" wait for all thread finish. - But without join(), simply this script will not work, file size return 0 byte because the file write before the download task finish. - So I want to make threading work like this: + Download a file with 4 threads + Thread 1 download finish, stream thread 1 data then wait till thread 2 finsh, join thread 2 with thread 1, but even thread 3, 4 finish earlier than thread 2, thread 3, 4 should not join with thread 1 because that action will break the file, it must wait till thread 2 finish then join 1 with 2, then join 3, 4 with. |
|||
|
« Next Oldest | Next Newest »
|

Search
Member List
Calendar
Help





![[-]](images/ONi/collapse.gif)