Giter Site home page Giter Site logo

unsee-dl's People

Contributors

andsala avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

unsee-dl's Issues

Broken and fails in unsee Beta.

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.

setting timeout variable??

Wondering if there was a means to set the timeout variable. My connections are timing out much too quickly.

After update of unsee.cc script stopped working

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?

No images found in album

unsee-dl not working - I get No images found in album for all downloadable albums.

I guess, unsee changed something

Anyone facing similar issue?

Only downloads the first image.

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?

Script completes successfully, but outputs traceback info

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.

KeyError: 'data' -- failing only on unsee Beta

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.

https://stackoverflow.com/questions/66306834/pythongraphql-keyerror-data-received-response-from-websocket-server-change

Yet another change in unsee beta api... "GRAPHQL_VALIDATION_FAILED" appears to be an easy fix.

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"])

Unsee Beta released

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?

Error when using newest Beta release: "No images found in album"

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.

TypeError: __init__() got an unexpected keyword argument 'encoding'

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.

2 for 1: `WSServerHandshakeError: 400` and `ClientConnectorError: Cannot connect...no address`

Unsee alpha has been relabeled to old unsee, unsee beta has been released and is now the new unsee. Currently, receiving errors on both.

  1. Unsee Alpha
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.

  1. Unsee Beta
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.

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.