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

パラメータ不正エラー #9

Closed
m4kur4 opened this issue May 3, 2021 · 2 comments
Closed

パラメータ不正エラー #9

m4kur4 opened this issue May 3, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@m4kur4
Copy link
Owner

m4kur4 commented May 3, 2021


https://www.pixiv.net/users/20207215

OSError: [WinError 87] パラメーターが間違っています。: 'images/Nam(20207215)/79444708_p0.jpg' -> 'images/Nam(20207215)/:D.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\2021_dev\pxv-blkdl\src\pxv_blkdl.py", line 412, in <module>
    idl.fetch_image_all_by_userid(args.user_id)
  File "D:\2021_dev\pxv-blkdl\src\pxv_blkdl.py", line 228, in fetch_image_all_by_userid
    self.fetch_image(work, save_dir_base)
  File "D:\2021_dev\pxv-blkdl\src\pxv_blkdl.py", line 254, in fetch_image
    self.rename_image(save_dir_base, image_id, image_title, image_url, 0, True)
  File "D:\2021_dev\pxv-blkdl\src\pxv_blkdl.py", line 318, in rename_image
    move(file_name_org, file_name)
  File "C:\Python39\lib\shutil.py", line 820, in move
    copy_function(src, real_dst)
  File "C:\Python39\lib\shutil.py", line 435, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "C:\Python39\lib\shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
OSError: [Errno 22] Invalid argument: 'images/Nam(20207215)/:D.jpg'
@m4kur4 m4kur4 self-assigned this May 3, 2021
@m4kur4 m4kur4 added the bug Something isn't working label May 3, 2021
@m4kur4
Copy link
Owner Author

m4kur4 commented May 4, 2021

@m4kur4
Copy link
Owner Author

m4kur4 commented May 4, 2021

全角に変換する

	def conv_file_name_safe(self, file_name):
		"""ファイルパスに使用できない文字を変換する
		"""
		# 変換前:変換後のマッピング(とりあえず使用禁止文字は全角にしておけば良い感)
		conv_map = {
			'\\':'¥',
			'/': '/',
			':': ':',
			'*': '*',
			'?': '?',
			'<': '<',
			'>': '>',
			'|': '|'
		}

@m4kur4 m4kur4 closed this as completed May 4, 2021
@m4kur4 m4kur4 reopened this May 4, 2021
m4kur4 added a commit that referenced this issue May 4, 2021
@m4kur4 m4kur4 closed this as completed May 4, 2021
m4kur4 added a commit that referenced this issue May 4, 2021
m4kur4 added a commit that referenced this issue May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant