GHC 2018-01-04

4 comments.

, https://git.io/vNfJO in soimort/you-get
Just realized this only fixes `--info`, `--url` and `--json`; actually downloading the URLs result in HTTP 466. It is not immediately obvious to me how to fix that part; I know that downloading from `tx.acgvideo.com` now requires a valid user agent in addition to referer, but the URLs extracted by you-get can't be downloaded either way. I'll look into it later.
  

, https://git.io/vNvN9 in soimort/you-get
[bilibili] fix 403 error when requesting interface.bilibili.com
===============================================================

interface.bilibili.com now requires referer to be set.

, https://git.io/vNv9s in jarun/googler
Just to offer an actual solution instead of saying "not our problem":

`os.get_terminal_size` is [implemented in C](https://github.com/python/cpython/blob/bbdb17d19bb1d5443ca4417254e014ad64c04540/Modules/posixmodule.c#L11063-L11064), so it's hard to properly port it to 3.2.*. However, if you cheat and shell out, you can get it working at least for googler's needs. Here's a patch.

```diff
diff --git a/googler b/googler
index 8ddbf59..cc1b835 100755
--- a/googler
+++ b/googler
@@ -46,6 +46,21 @@ except ImportError:
     pass
 
 
+if not hasattr(os, 'get_terminal_size'):
+    def get_terminal_size():
+        try:
+            stty_size = subprocess.check_output(
+                ['stty', 'size'],
+                stderr=subprocess.PIPE,
+            ).decode('utf-8')
+            lines_str, columns_str = stty_size.split()
+            return (int(columns_str), int(lines_str))
+        except Exception:
+            return (80, 24)
+
+    os.get_terminal_size = get_terminal_size
+
+
 # Basic setup
 
 try:
```

If you don't like all the forking going on here, you can also just return a static `(80, 24)`, for instance.

Btw, Debian Wheezy is reaching EOL soon (May 2018), too.

, https://git.io/vNvL9 in jarun/googler
Even Python 3.3 has reached EOL in September 2017. If you're using Python <3.4, you're on your own, dude.