19 Commits

Author SHA1 Message Date
Mike Fährmann
b69e5a7a58 [scripts/init] use 'operator +' when building 'pattern' 2025-12-22 11:31:48 +01:00
MyFinalBellyache
2bff6828e1 [scripts/init] Fix error running with default values (#8583)
Fixes:
```sh
python scripts/init.py newsite https://newsite.com
# [INFO] gallery_dl/extractor/newsite.py
# [ERROR] TypeError: 'NoneType' object is not iterable
# Traceback (most recent call last):
#   File "/gallery-dl/scripts/init.py", line 58, in init_extractor
#     fp.write(func(args))
#              ^^^^^^^^^^
#   File "/gallery-dl/scripts/init.py", line 88, in generate_module
#     {generate_extractors(args)}\
#      ^^^^^^^^^^^^^^^^^^^^^^^^^
#   File "/gallery-dl/scripts/init.py", line 108, in generate_extractors_basic
#     for subcat in args.subcategories:
# TypeError: 'NoneType' object is not iterable
# [INFO] gallery_dl/extractor/__init__.py
# [INFO] test/results/newsite.py
```
2025-11-20 11:00:35 +01:00
Mike Fährmann
ddc8c8ae09 [scripts/init] implement specifying a site's URL as 'category' 2025-10-02 11:51:32 +02:00
Mike Fährmann
752245ac39 [scripts/init] convert 'category' names to lowercase 2025-09-09 22:06:13 +02:00
Mike Fährmann
df158995f7 [scripts/init] add '--no-test' option 2025-08-27 21:33:56 +02:00
Mike Fährmann
82318ffc6d [scripts/init] add '--subcategory' option 2025-08-27 21:31:31 +02:00
Mike Fährmann
57a4b5b5b1 [scripts/util] add 'lines()' helper 2025-08-23 19:53:07 +02:00
Mike Fährmann
7dbd3e40f7 [scripts/init] add '-g/--git' command-line option 2025-08-17 23:51:49 +02:00
Mike Fährmann
f23f506362 [scripts/init] refactor 2025-08-17 23:51:49 +02:00
Mike Fährmann
253d498a4e [scripts/util] add 'trim()' helper 2025-08-05 21:55:05 +02:00
Mike Fährmann
3dd1372a0b [scripts/init] use 'args' directly 2025-08-05 21:06:24 +02:00
Mike Fährmann
0364092241 [scripts/init] add '-M/--no-module' command-line option 2025-08-05 19:52:00 +02:00
Mike Fährmann
876df379f4 [scripts/init] add '-C' command-line option 2025-07-28 21:50:28 +02:00
Mike Fährmann
e8b2a496ba [scripts] ensure files use 'utf-8' encoding and '\n' newlines (#7872) 2025-07-22 20:57:54 +02:00
Mike Fährmann
493fc483c6 [scripts/init] handle subdomains when building BASE_PATTERN 2025-07-17 18:38:54 +02:00
Mike Fährmann
df946faf40 [scripts/init] fix extra blank line without copyright
1686f32a0d (commitcomment-162021403)
2025-07-14 16:54:21 +02:00
Mike Fährmann
1686f32a0d [scripts/init] split into separate scripts
- init.py:
    - generate initial extractor module code and test result file
    - insert new entries into modules list and site names
- generate_test_result.py:
    - generate test result for a given URL
    - insert it into the test result file generated by init.py
      (or an already existing one)
2025-07-12 21:14:29 +02:00
Mike Fährmann
dd759d34dd [scripts/init] support adding test results via '--url' 2025-06-23 17:16:11 +02:00
Mike Fährmann
eaeabda7ac [scripts] implement 'init.py'
Initial attempt at a helper script to generate new extractor module
files and the required boilerplate code.
2025-06-22 10:13:06 +02:00