Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weired pdf error #76

Open
shopconan opened this issue May 20, 2022 · 3 comments
Open

weired pdf error #76

shopconan opened this issue May 20, 2022 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shopconan
Copy link

url to pdf ERROR b'Traceback (most recent call last):\n File "/opt/hostedtoolcache/Python/3.10.4/x64/bin/shot-scraper", line 8, in \n sys.exit(cli())\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1130, in call\n return self.main(*args, **kwargs)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1055, in main\n rv = self.invoke(ctx)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1657, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 1404, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages/click/core.py", line 760, in invoke\n return __callback(*args, **kwargs)\n File "/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packag...

pdfname=url.split('/')[-1]

if not os.path.exists(join(pdfpath,pdfname+'.pdf')):
    cmd='shot-scraper pdf {url} -o {pdfname}.pdf'
    isdone=subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
    out, err = isdone.communicate()
@shopconan
Copy link
Author

shot-scraper pdf https://www.indiehackers.com/interview/growing-a-sound-effects-app-for-mac-to-1-000-mo-f522c242fc -o growing-a-sound-effects-app-for-mac-to-1-000-mo-f522c242fc.pdf
url to pdf ERROR b"Screenshot of 'https://www.indiehackers.com/interview/growing-a-sound-effects-app-for-mac-to-1-000-mo-f522c242fc' written to 'growing-a-sound-effects-app-for-mac-to-1-000-mo-f522c242fc.pdf'\n"
b''
@simonw

@shopconan
Copy link
Author

another windows machine
3.8.0

 shot-scraper pdf "https://datasette.io/"
Traceback (most recent call last):
  File "D:\Program Files\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\Program Files\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "D:\Program Files\anaconda3\Scripts\shot-scraper.exe\__main__.py", line 7, in <module>
    sys.exit(cli())
  File "D:\Program Files\anaconda3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "D:\Program Files\anaconda3\lib\site-packages\click\core.py", line 1053, in main 
    rv = self.invoke(ctx)
  File "D:\Program Files\anaconda3\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "D:\Program Files\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "D:\Program Files\anaconda3\lib\site-packages\click\core.py", line 754, in invoke

    return __callback(*args, **kwargs)
  File "D:\Program Files\anaconda3\lib\site-packages\shot_scraper\cli.py", line 515, in pdf
    url = url_or_file_path(url, _check_and_absolutize)
  File "D:\Program Files\anaconda3\lib\site-packages\shot_scraper\utils.py", line 27, in url_or_file_path
    file_path = file_exists(url)
  File "D:\Program Files\anaconda3\lib\site-packages\shot_scraper\cli.py", line 621, in _check_and_absolutize
    if path.exists():
  File "D:\Program Files\anaconda3\lib\pathlib.py", line 1388, in exists
    self.stat()
  File "D:\Program Files\anaconda3\lib\pathlib.py", line 1194, in stat
    return self._accessor.stat(self)
OSError: [WinError 123] 文件名、目录名或卷标语法不正确。: 'https:\\datasette.io'        

@simonw simonw added bug Something isn't working help wanted Extra attention is needed labels Jul 27, 2022
@simonw
Copy link
Owner

simonw commented Jul 27, 2022

Looks like this is a bug on Windows. Can anyone provide steps to reproduce and replicate in a fresh Windows development environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants