Code Monkey home page Code Monkey logo

get_tumblr_likes's Introduction

Hi there 👋

Anurag's github stats

Top Langs

get_tumblr_likes's People

Contributors

cyang812 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

get_tumblr_likes's Issues

Issue

I do have one question. This application can't download deleted posts from likes, right? For example, if the post you liked got deleted?

Thank you.

IndexError: list index out of range

liked_timestamp = data['response']['liked_posts'][res_item_len-1]['liked_timestamp']
IndexError: list index out of range

这句报错,我查了一下,用浏览器打开同个链接可以得到正确的数据;
但在 IDE 中,得到的总是空的 "liked_posts", 所以越界了。
请问这种事为什么没得到正确的数据?谢谢

Bug Report

以下是错误信息

<Response [200]>
like_item = 924
<Response [200]>
res_item_len = 0
Traceback (most recent call last):
File "run.py", line 13, in
get_json_v3.main()
File "/root/tumblr-download/get_tumblr_likes/get_json_v3.py", line 62, in main
liked_timestamp = data['response']['liked_posts'][res_item_len-1]['liked_timestamp']
IndexError: list index out of range

查了一下应该是返回的数据中有空格导致读取时出错,求修复

解决**无法连接到代理服务器**的报错

把 PROXIES 改成如下形式就能连接到代理了。

PROXIES = {
    "http": "socks5h://127.0.0.1:1080",
    "https": "socks5h://127.0.0.1:1080"
}

我改了下面这三个文件中的 PROXIES:
get_json_v3.py
download_process.py
download.py

我用的是 ss 代理,这个项目默认的 { "http": "http://127.0.0.1:1080", "https": "https://127.0.0.1:1080" } 连接不了。

解决的报错:

(Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001FFD0C75898>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))

requirement.txt seems somewhere wrong and can't download my own account

pip3.6 install -r requirements.txt
Invalid requirement: 'requests ~> 2.20.0'
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "'~> 2.20.'": Expected stringEnd

Maybe some hidden character?
Temporarily change line 2 to requests==2.20.0, finally succeeded.

https://api.tumblr.com/v2/blog/*******.tumblr.com/likes?limit=2&api_key=mqyfWchrSDffLHqst0k9xLCvsI5JaCyTPJG3ZdCLyQJVm0FX2V
<Response [200]>
{'meta': {'status': 200, 'msg': 'OK'}, 'response': {'liked_posts': [], 'liked_count': 2378}}

Info api returns "'share_likes': True",but can't get liked_posts.
And try another blogger's account, download succeeded with 1 pic.
Don't know what is wrong.[sad]

pip install -r requirements.txt会报错

Invalid requirement: 'requests > 2.20.0'
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/_internal/req/constructors.py", line 253, in install_req_from_line
req = Requirement(req)
File "/Library/Python/2.7/site-packages/pip/_vendor/packaging/requirements.py", line 96, in init
requirement_string[e.loc:e.loc + 8], e.msg
InvalidRequirement: Parse error at "u'
> 2.20.'": Expected stringEnd

注释掉后运行ok

我的一直报 由于目标计算机积极拒绝,无法连接这个错

#1 get_json main()
tumblr.cfg
Traceback (most recent call last):
File "site-packages\urllib3\connection.py", line 141, in _new_conn
File "site-packages\urllib3\util\connection.py", line 83, in create_connection
File "site-packages\urllib3\util\connection.py", line 73, in create_connection
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages\urllib3\connectionpool.py", line 595, in urlopen
File "site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
File "site-packages\urllib3\connection.py", line 284, in connect
File "site-packages\urllib3\connection.py", line 150, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages\requests\adapters.py", line 440, in send
File "site-packages\urllib3\connectionpool.py", line 639, in urlopen
File "site-packages\urllib3\util\retry.py", line 388, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/user/info (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))) During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 14, in
get_json.main()
File "get_json.py", line 102, in main
resp = requests.get(info_url, allow_redirects=False, auth=oauth, proxies=PROXIES)
File "site-packages\requests\api.py", line 72, in get
File "site-packages\requests\api.py", line 58, in request
File "site-packages\requests\sessions.py", line 508, in request
File "site-packages\requests\sessions.py", line 618, in send
File "site-packages\requests\adapters.py", line 502, in send
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/user/info (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)))

我的一直报 由于目标计算机积极拒绝,无法连接这个错

#1 get_json main()
tumblr.cfg
Traceback (most recent call last):
File "site-packages\urllib3\connection.py", line 141, in _new_conn
File "site-packages\urllib3\util\connection.py", line 83, in create_connection
File "site-packages\urllib3\util\connection.py", line 73, in create_connection
ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages\urllib3\connectionpool.py", line 595, in urlopen
File "site-packages\urllib3\connectionpool.py", line 816, in _prepare_proxy
File "site-packages\urllib3\connection.py", line 284, in connect
File "site-packages\urllib3\connection.py", line 150, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "site-packages\requests\adapters.py", line 440, in send
File "site-packages\urllib3\connectionpool.py", line 639, in urlopen
File "site-packages\urllib3\util\retry.py", line 388, in increment
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/user/info (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',))) During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 14, in
get_json.main()
File "get_json.py", line 102, in main
resp = requests.get(info_url, allow_redirects=False, auth=oauth, proxies=PROXIES)
File "site-packages\requests\api.py", line 72, in get
File "site-packages\requests\api.py", line 58, in request
File "site-packages\requests\sessions.py", line 508, in request
File "site-packages\requests\sessions.py", line 618, in send
File "site-packages\requests\adapters.py", line 502, in send
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/user/info (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x000001E0D4D99278>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)))

两种方案都失败了

Hi,感谢您能在当下提供这么好的工具。

我尝试使用 get_json_v3,结果报错;

#1 get_json main()
Please input blog_id:XXXXX
<Response [200]>
like_item = 275
<Response [200]>
res_item_len = 0
Traceback (most recent call last):
File "run.py", line 14, in
get_json_v3.main()
File "/Users/Me/Downloads/get_tumblr_likes-master/get_json_v3.py", line 62, in main
liked_timestamp = data['response']['liked_posts'][res_item_len-1]['liked_timestamp']
IndexError: list index out of range

如果使用 get_json_v2,则这样婶儿的:

#1 get_json main()
tumblr.cfg
<Response [200]>
like_item = 275
<Response [200]>
res_item_len = 1
liked_timestamp = 1543907623
<Response [200]>
res_item_len = 11
liked_timestamp = 1538609700
<Response [200]>
res_item_len = 11
liked_timestamp = 1527015559
<Response [200]>
res_item_len = 11
liked_timestamp = 1521760899
<Response [200]>
res_item_len = 11
liked_timestamp = 1517356355
<Response [200]>
res_item_len = 11
liked_timestamp = 1516033795
<Response [200]>
res_item_len = 11
liked_timestamp = 1513725378
<Response [200]>
res_item_len = 11
liked_timestamp = 1511711973
<Response [200]>
res_item_len = 11
liked_timestamp = 1509577245
<Response [200]>
res_item_len = 11
liked_timestamp = 1506825792
<Response [200]>
res_item_len = 11
liked_timestamp = 1504627361
<Response [200]>
res_item_len = 11
liked_timestamp = 1502205643
<Response [200]>
res_item_len = 11
liked_timestamp = 1501599278
<Response [200]>
res_item_len = 11
liked_timestamp = 1481893975
<Response [200]>
res_item_len = 10
liked_timestamp = 1462874347
<Response [200]>
res_item_len = 0
#2 json_parse main()
list_len = 15
item_len = 1
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 11
item_len = 10
item total = 154
#3 download_process main()
downloading...............
list_len = 473

然后就卡着了完全不动……看了下 url_list.txt 已经有 url 了,url 通过浏览器也能打开。

希望能够得到您的解答,不尽感激~

Can't download all liked post (It exist, duplicate rows in url_list.txt)

great tools by the way,
but there's error.

JSON creation done,
parsing done,
downloading files: after some 3000 files, terminal says it exist.
which is weird, because liked post on tumblr never duplicates.

i checked the url_list.txt file from json parsing,
and yes there's a lot rows duplicated after 3000 row or so.

有不少内容漏下载了

我用了v2下载,下载了大部分内容,但是还是有不少内容没有下载,试了很多遍也是这样,为啥呢?我在网页中可以手动下载,图片与视频的网址链接没有问题,如何下载全部内容?

无法获取likes.json

<Response [429]>
error {'meta': {'status': 429, 'msg': 'Limit Exceeded'}, 'errors': [{'detail': 'Minor hiccup. Try again.', 'title': 'Limit Exceeded', 'code': 0}], 'response': []}
[error]: blog is not exist

是代码里的api key的原因吗?
使用的是get_json_v3.py下载的。

如何在tumblr中设置分享自己的likes

,是在privacy dashboard里面吗?可是现在完全登不了这个页面。一直提示要证明自己不是机器人,但验证码刷不出来。用的是vps shadowsock上网。

大神你好!Mac环境下运行run.py报错

如下所示,填写ID后,就这样了

#1 get_json main()
Please input blog_id:xxxxxxxxxx
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 83, in create_connection
raise err
File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 595, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 816, in _prepare_proxy
conn.connect()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x10d284a90>: Failed to establish a new connection: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
timeout=timeout
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/blog/xxxxxxxxx.tumblr.com/info?api_key=mqyfWchrSDffLHqst0k9xLCvsI5JaCyTPJG3ZdCLyQJVm0FX2V (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d284a90>: Failed to establish a new connection: [Errno 61] Connection refused',)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "run.py", line 13, in
get_json_v3.main()
File "/Users/maxiaoming/Desktop/get_tumblr_likes-master/get_json_v3.py", line 24, in main
resp = requests.get(info_url, proxies=PROXIES)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 502, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/blog/xxxxxxxxx.tumblr.com/info?api_key=mqyfWchrSDffLHqst0k9xLCvsI5JaCyTPJG3ZdCLyQJVm0FX2V (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d284a90>: Failed to establish a new connection: [Errno 61] Connection refused',)))

这是遇到了什么问题呢,小白完全看不懂
求指教,感谢啦~

获取喜欢列表链接被拒

如下提示,虽然挂了ssr,但是貌似还是代理出了问题
`
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File ".\get_json_v3.py", line 104, in
main()
File ".\get_json_v3.py", line 24, in main
resp = requests.get(info_url, proxies=PROXIES)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\site-packages\requests\adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.tumblr.com', port=443): Max retries exceeded with url: /v2/blog/xxxxxxxxxxxx.tumblr.com/info?api_key=mqyfWchrSDffLHqst0k9xLCvsI5JaCyTPJG3ZdCLyQJVm0FX2V (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000215845EB7B8>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。',)))
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.