Coder Social home page Coder Social logo

sv-dlp's Introduction

Hi, I'm Juan! ๐Ÿ‘‹

Languages & Frameworks

Python Golang JavaScript TypeScript

Astro Next.js ReactNative Tailwind

Django Flask MySQL PostgreSQL

Featured Projects

Socials

sv-dlp's People

Contributors

dependabot[bot] avatar shmugoh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vistone

sv-dlp's Issues

Clean Syntax

Been re-reading this script after 2 weeks of procrastinating, and holy crap some of it is so dirty. Some variables/modules aren't named well (mostly in the extractor side), some functions' algorithms are too dirty to read, and the way the extractor works is just weird (idk how to explain it).

I'd suggest doing the following:

  • Rename extractor -> services
  • Rename postdownload -> download
  • Rewrite (most of) postdownload; use a different algorithm for the progress bar and multi-threading
  • Change the way the CLI communicates with the service script
  • Clean up the CLI front-end

[dev] Migrate to readthedocs.io

GitHub Workflow is very painful to troubleshoot, and attempting to automate mkdocs with every new version is gonna cause more issues (and more meaningless commits!); readthedocs does it all automatically, which saves me a lot of time.

[CLI] Zoom being parsed as string instead of integer

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\sv-dlp.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\sv_dlp\__main__.py", line 140, in main
    img = sv_dlp.download_panorama(pano_id=pano, lat=lat, lng=lng, zoom=zoom)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\__init__.py", line 153, in download_panorama
    tile_arr = self.service._build_tile_arr(self.metadata, zoom)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\services\yandex.py", line 179, in _build_tile_arr
    zoom = max_zoom - zoom
           ~~~~~~~~~^~~~~~
TypeError: unsupported operand type(s) for -: 'int' and 'str'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\sv-dlp.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\sv_dlp\__main__.py", line 140, in main
    img = sv_dlp.download_panorama(pano_id=pano, lat=lat, lng=lng, zoom=zoom)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\__init__.py", line 153, in download_panorama
    tile_arr = self.service._build_tile_arr(self.metadata, zoom)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\services\google\__init__.py", line 209, in _build_tile_arr
    x_axis = metadata.size[0][zoom][0][1] // metadata.size[1][1]
             ~~~~~~~~~~~~~~~~^^^^^^
TypeError: list indices must be integers or slices, not str

[GLOBAL] --get-linked-panos not working

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\sv-dlp.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\sv_dlp\__main__.py", line 131, in main
    sv_dlp.get_metadata(pano_id=pano, lat=lat, lng=lng, get_linked_panos=args.linked_panos)
  File "C:\Python311\Lib\site-packages\sv_dlp\__init__.py", line 239, in get_metadata
    md = self.service.metadata.get_metadata(pano_id=pano_id, lat=lat, lng=lng, get_linked_panos=get_linked_panos)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\services\google\__init__.py", line 125, in get_metadata
    md = metadata._parse_panorama(md, raw_md, output="linked_panos")
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\sv_dlp\services\google\__init__.py", line 150, in _parse_panorama
    md["linked_panos"] = {}
    ~~^^^^^^^^^^^^^^^^
TypeError: 'MetadataStructure' object does not support item assignment

[DOWNLOAD] File not being saved correctly

Cropping...
Traceback (most recent call last):
  File "__main__.py", line 249, in <module>
  File "__main__.py", line 181, in main
  File "download/download.py", line 85, in panorama
  File "PIL/Image.py", line 2209, in save
FileNotFoundError: [Errno 2] No such file or directory: './.\\/ZKtxVmsrUTRvD_7HgCm28A.png'
[64368] Failed to execute script '__main__' due to unhandled exception!

A temporal fix to this would be parsing a --folder flag with two quotes and no value ('')

[BUILD] pillow-heif doubling compiled executable up to 40MB

After a lot, but A LOT of commits tinkering with the Actions script (such as using UPX and installing required system modules for Linux), I just came to the conclusion that pillow_heif is dramatically doubling the file size from 26.6MB up to 43.7MB on Linux.

Windows is the less affected by this, although I had to drop support for x86 due to pillow_heif not supporting it (although let's be real, who uses x86 nowadays?)

Until pillow_heif gets optimized for pyinstaller or an alternative comes out, I won't fix this.

[NAVAE] Short URL API not being used

I have been consistently encountering a 401 error every time I make (the Short URL) API call to requestJsonpV2.
It requires a valid callback ID, however, I have been unable to find a way to generate a valid one, as they inmediately expire whenever they're used.

[YANDEX] Short URL API not working

I've been trying to access the Yandex Short URL API as of lately (since sv-dlp doesn't really short Yandex links by the API. It just shorts them by parsing the panorama on a long link) but it requires a few tokens - csrfToken isn't a problem, as Yandex will generate you one if you input an invalid one, but I'm not sure about the s and sessionId.

image
image

By using ones that I've already generated by myself (as seen in the picture), it returns me a 403 error with the following message
image
Help is appreciated

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.