andsala / unsee-dl Goto Github PK
View Code? Open in Web Editor NEWunsee.cc downloader
Home Page: https://pypi.org/project/unsee-dl/
License: MIT License
unsee.cc downloader
Home Page: https://pypi.org/project/unsee-dl/
License: MIT License
For some reason, the newest release does not remove the watermark with the users IP address when downloading.
Something must have changed with unsee's API, I am getting the same error that the server has disconnected. Here is my output:
Traceback (most recent call last):
File "/usr/local/bin/unsee-dl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/main.py", line 13, in main
asyncio.get_event_loop().run_until_complete(run_downloader())
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/site-packages/main.py", line 78, in run_downloader
await client.anonymous_login()
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_beta.py", line 60, in anonymous_login
async with self.session.post(
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 504, in _request
await resp.start(conn)
File "/usr/local/lib/python3.8/site-packages/aiohttp/client_reqrep.py", line 847, in start
message, payload = await self._protocol.read() # type: ignore # noqa
File "/usr/local/lib/python3.8/site-packages/aiohttp/streams.py", line 591, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError
Command flat out fails on attempt to download unsee-beta galleries. Does not even make the initially connection to pull down quantity in gallery.
Script no longer works on both old unsee and new unsee. Does not output album id as it use to, it reports there are 0 images in album, downloads nothing, and no errors are given.
Wondering if there was a means to set the timeout variable. My connections are timing out much too quickly.
Downloading album ...
ERROR:root:Failed downloading album .
Traceback (most recent call last):
File "\lib\site-packages\aiohttp\connector.py", line 1152, in _create_direct_connection
hosts = await asyncio.shield(host_resolved)
File "\lib\site-packages\aiohttp\connector.py", line 874, in _resolve_host
addrs = await self._resolver.resolve(host, port, family=self._family)
File "\lib\site-packages\aiohttp\resolver.py", line 38, in resolve
flags=socket.AI_ADDRCONFIG,
File "\lib\asyncio\base_events.py", line 789, in getaddrinfo
None, getaddr_func, host, port, family, type, proto, flags)
File "\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "\lib\socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "\lib\site-packages\main.py", line 23, in download_old
await client.download_album(album_id)
File "\lib\site-packages\unsee_dl\unsee_old.py", line 111, in download_album
_UNSEE_WEBSOCKET_URL.format("settings") + ws_params, ssl=ssl_context
File "\lib\site-packages\aiohttp\client.py", line 1141, in aenter
self._resp = await self._coro
File "\lib\site-packages\aiohttp\client.py", line 789, in _ws_connect
proxy_headers=proxy_headers,
File "\lib\site-packages\aiohttp\client.py", line 537, in _request
req, traces=traces, timeout=real_timeout
File "\lib\site-packages\aiohttp\connector.py", line 540, in connect
proto = await self._create_connection(req, traces, timeout)
File "\lib\site-packages\aiohttp\connector.py", line 901, in _create_connection
_, proto = await self._create_direct_connection(req, traces, timeout)
File "\lib\site-packages\aiohttp\connector.py", line 1166, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host old.unsee.cc:443 ssl:<ssl.SSLContext object at 0x0397D8E8> [getaddrinfo failed]
Ofcourse I have no idea what is wrong because I'm total noob, does anyone know how to fix it?
Can you please provide a better explanation on how to use the program on the command line
For some reason, the newest release does not remove the watermark with the users IP address when downloading.
unsee-dl not working - I get No images found in album
for all downloadable albums.
I guess, unsee changed something
Anyone facing similar issue?
When using your most awesome app, I noticed that it only downloads the first image of every gallery. It does not download any other image but the first. Is there a reason why this is happening?
Not a critical issue by any stretch of the imagination. I am so thankful for the work that you have already performed. Just wanted to inform you of the script dumping traceback information after being run successfully. It reports a "KeyError".
INFO:root:Download completed for album xxxxxxxx.
Traceback (most recent call last):
File "/usr/local/bin/unsee-dl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/main.py", line 13, in main
asyncio.get_event_loop().run_until_complete(run_downloader())
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/site-packages/main.py", line 46, in run_downloader
await client.anonymous_login()
File "/usr/local/lib/python3.7/site-packages/unsee_dl/unsee_beta.py", line 78, in anonymous_login
self.token = content['data']['login']['token']
KeyError: 'data'
Let me know if there is anyway I can help.
I am assuming that this Morning unsee apparently changed it's graphql scheme. Because where it worked up until 5am last night, it no longer does. Noe the following error is generated.
Traceback (most recent call last):
File "/unsee-dl/main.py", line 104, in <module>
main()
File "/unsee-dl/main.py", line 14, in main
asyncio.get_event_loop().run_until_complete(run_downloader())
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/unsee-dl/main.py", line 98, in run_downloader
await download_beta(album_ids_beta_version, args.out_dir, args.group_album)
File "/unsee-dl/main.py", line 33, in download_beta
await client.anonymous_login()
File "/unsee-dl/unsee_dl/unsee_beta.py", line 62, in anonymous_login
tokens = content["data"]["getToken"]
KeyError: 'data
I am comfortable making minor corrections, and understand the basics of what a key error is. As for going about troubleshooting this error, I am completely lost.
Unsee changed the api behind the beta version again causing attempts to get session info for the script to fail, and we now recieve the error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/main.py", line 39, in download_beta
await client.download_album(album_id)
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_beta.py", line 69, in download_album
async for album_image in self._original_size_images(album_id):
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_beta.py", line 193, in _original_size_images
await self._create_session(album_id)
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_beta.py", line 127, in _create_session
raise Exception(content["errors"])
Exception: [{'message': 'Field "chat" must not have a selection since type "ID" has no subfields.', 'locations': [{'line': 13, 'column': 7}], 'extensions': {'code': 'GRAPHQL_VALIDATION_FAILED'}}]
I know this is perhaps very little to no help at all in diagnosing the problem, but appears the error is somewhere in the following block of code from unsee_beta.py. More structure probably was added to the variable 'ID', if that makes any sense.
async def _create_session(self, album_id):
# getSessions
headers = {"authorization": f"Bearer {self.token}"}
gql_body = {
"operationName": "getSessions",
"variables": {"filter": {"chat": album_id}},
"query": """
query getSessions($filter: SessionFilter!, $pagination: Pagination) {
getSessions(filter: $filter, pagination: $pagination) {
...SessionFragment
__typename
}
}
fragment SessionFragment on Session {
id
role
status
chat {
...ChatFragment
__typename
}
online
created
viewing
user
name
__typename
}
fragment ChatFragment on Chat {
id
title
ttl
ttlLeft
status
description
created
updated
allowDownloads
allowUploads
watermarkIp
deleteAfter
__typename
}
""",
}
async with self.session.post(
_GRAPHQL_URL, json=gql_body, headers=headers
) as response:
content = await response.json()
if "errors" in content and len(content["errors"]) > 0:
raise Exception(content["errors"])
I so appreciate you writing this script, use it daily actually.
There is now unsee Beta which uses a sixteen digit identifier rather than an eight digit. Are there any plans to support the new version of unsee?
Issue is only with the newest version of Beta Unsee. Returns error that "No images found in album..."
Adding the verbose flag to the command does not generate any more additional data.
Does not matter whether downloads are enabled or not, same error is given.
Does not matter whether uploads are enabled.
Responds as if it cannot find any images at all. Response is immediate, and possibly not related to a timeout.
I am not getting anything to download both in old and new. When running the script for the pypi installed package, I received the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/main.py", line 23, in download_old
await client.download_album(album_id)
File "/usr/local/lib/python3.9/site-packages/unsee_dl/unsee_old.py", line 116, in download_album
settings = json.loads(data.data, encoding="utf-8")
File "/usr/local/lib/python3.9/json/__init__.py", line 359, in loads
return cls(**kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'encoding'
But, when I run it directly from the reposity, I don't recieve the same error. Just a simple Found album with 0 images
.
Unsee alpha has been relabeled to old unsee, unsee beta has been released and is now the new unsee. Currently, receiving errors on both.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/main.py", line 23, in download_old
await client.download_album(album_id)
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_dl.py", line 46, in download_album
async with self.session.ws_connect(
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 733, in _ws_connect
raise WSServerHandshakeError(
aiohttp.client_exceptions.WSServerHandshakeError: 400, message='Invalid response status', url=URL('wss://ws.unsee.cc/settings/?album=9ee5e20e&name=Leonel')
I have not quite figured out websockets yet, so I am lost as for what this error could be.
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 964, in _create_direct_connection
hosts = await asyncio.shield(self._resolve_host(
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 829, in _resolve_host
addrs = await \
File "/usr/local/lib/python3.8/site-packages/aiohttp/resolver.py", line 29, in resolve
infos = await self._loop.getaddrinfo(
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 825, in getaddrinfo
return await self.run_in_executor(
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] no address associated with name
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/unsee-dl", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/site-packages/main.py", line 14, in main
asyncio.get_event_loop().run_until_complete(run_downloader())
File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/usr/local/lib/python3.8/site-packages/main.py", line 98, in run_downloader
await download_beta(album_ids_beta_version, args.out_dir, args.group_album)
File "/usr/local/lib/python3.8/site-packages/main.py", line 33, in download_beta
await client.anonymous_login()
File "/usr/local/lib/python3.8/site-packages/unsee_dl/unsee_beta.py", line 58, in anonymous_login
async with self.session.post(_GRAPHQL_URL, json=gql_body) as response:
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1012, in __aenter__
self._resp = await self._coro
File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 480, in _request
conn = await self._connector.connect(
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 523, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 858, in _create_connection
_, proto = await self._create_direct_connection(
File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 971, in _create_direct_connection
raise ClientConnectorError(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host api3.unsee.cc:443 ssl:default [no address associated with name]
The above might be something as simple as the server listening on a different subdomain, for example listening on api.unsee.cc instead of api3.unsee.cc.
Both errors began to occur at the same time which was very early in the morning at around 7 am Berlin time. The change was also instantaneous, one minute it was working and the next minute it was not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.