GHC 2016-11-21

6 comments.

, https://git.io/v1KUV in soimort/you-get
Thanks for looking into the issue.

> If someone knows how to fix this properly, please just send them a patch.

Probably not me, but I just opened a ticket: https://trac.ffmpeg.org/ticket/5973.

, https://git.io/v1KUw in jarun/googler
Closed by accident... But I doubt we can do much about your PAC problem, since we need to be JavaScript-capable to be able to support PAC, which apparently won't happen.

Feel free to ask questions though, I'd be happy to provide pointers if I can.

, https://git.io/v1KUr in jarun/googler
As expected, Lantern configures the system proxy with a PAC file. Sorry, googler doesn't support that (neither does curl/wget/etc.). You might be able to find out which proxy nodes Lantern is connecting to (with tcpdump or Wireshark for instance) and manually set the proxy with our `--proxy` option.

, https://git.io/v1KUo in jarun/googler
Nevertheless, you could try this patch.

```diff
From 080bbf51114e0d6ea87f9887564edf343a49a8a2 Mon Sep 17 00:00:00 2001
From: Zhiming Wang <[email protected]>
Date: Mon, 21 Nov 2016 10:22:35 -0500
Subject: [PATCH] googler: allow multiple redirects

Fixes #145.
---
 googler | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/googler b/googler
index 4f055d4..07c63b2 100755
--- a/googler
+++ b/googler
@@ -627,8 +627,8 @@ class GoogleConnection(object):
     def fetch_page(self, url):
         """Fetch a URL.
 
-        Allows one reconnection and one redirection before failing and
-        raising GoogleConnectionError.
+        Allows one reconnection and multiple redirections before failing
+        and raising GoogleConnectionError.
 
         Parameters
         ----------
@@ -661,12 +661,17 @@ class GoogleConnection(object):
                 raise GoogleConnectionError("Failed to get '%s'." % url)
 
         resp = self._resp
-        if resp.status in {301, 302, 303, 307, 308}:
-            redirection_url = resp.getheader('location', '')
-            if 'sorry/IndexRedirect?' in redirection_url:
-                raise GoogleConnectionError('Connection blocked due to unusual activity.')
-            self._redirect(redirection_url)
-            resp = self._resp
+        redirect_counter = 0
+        while resp.status != 200 and redirect_counter < 5:
+            if resp.status in {301, 302, 303, 307, 308}:
+                redirection_url = resp.getheader('location', '')
+                if 'sorry/IndexRedirect?' in redirection_url:
+                    raise GoogleConnectionError('Connection blocked due to unusual activity.')
+                self._redirect(redirection_url)
+                resp = self._resp
+                redirect_counter += 1
+            else:
+                break
 
         if resp.status != 200:
             raise GoogleConnectionError('Got HTTP %d: %s' % (resp.status, resp.reason))
-- 
2.10.2

```

Also available as a gist: https://gist.github.com/anonymous/48f5aef33bcef4d40efe5548f30b5f69.

, https://git.io/v1KUK in jarun/googler
That doesn't help, you can't even finish the request with curl.

I don't know how Lantern works and can't seem to find an explanation (other than "better than a VPN" which is apparently marketing bullshit). My guess is it's a per-process proxy that covers your browsers but doesn't work with arbitrary processes like curl or googler's python.

, https://git.io/v1KU6 in jarun/googler
The problem is we only allow a one-time redirection, whereas you're being redirected multiple times. We've never seen this before. We could account for that, but I'd like to see the output of

```sh
$ curl -IL 'https://www.google.com/search?ie=UTF-8&num=10&oe=UTF-8&q=hello&start=0'
```

first.