Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
import asyncio
# % if cookiecutter.http_client == 'curl-impersonate'
import platform

# % if 'playwright' in cookiecutter.crawler_type
import warnings
# % endif
# % endif
{{ '' }}
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The {{ '' }} blank-line insertion may be unnecessary and could be replaced with a simpler newline in the template to improve readability.

Suggested change
{{ '' }}

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using an empty string, ignored when creating a result

from .main import main


if __name__ == '__main__':
# % if cookiecutter.http_client == 'curl-impersonate'
if platform.system() == 'Windows':
# This mitigates a warning raised by curl-cffi. If you do not need to use curl-impersonate, you may remove this.
# This mitigates a warning raised by curl-cffi.
Comment on lines 13 to +14
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The original guidance explaining how to remove this policy if not using curl-impersonate was removed—consider re-adding a brief note for users who may not need this workaround.

Copilot uses AI. Check for mistakes.
# % if 'playwright' in cookiecutter.crawler_type
warnings.warn(
message=('curl-cffi suggests using WindowsSelectorEventLoopPolicy, but this conflicts with Playwright. '
'Ignore the curl-cffi warning.'),
category=UserWarning,
stacklevel=2,
)
# % else
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

# % endif
# % endif
{{ '' }}
asyncio.run(main())
Loading