Skip to content

Commit f7034db

Browse files
committed
Update README
1 parent c1dd4d3 commit f7034db

1 file changed

Lines changed: 46 additions & 18 deletions

File tree

‎README.md‎

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22

33
Some small Python utilities.
44

5+
To use them, make sure you also downloaded `util.py` file from the same directory (or better, just clone the whole repo).
6+
7+
58
## `instalive.py`
69

7-
Instagram live downloader. Feed in MPD URL (including all the query parameters!) within 24 hour and it can download the full live stream from the beginning.
10+
Instagram live downloader. Feed in MPD URL (including all the query parameters!) within ~~24~~ (a few) hours and it can download the full live stream from the beginning.
811

912
Usage:
1013

1114
```
1215
usage: instalive.py [-h] [--action ACTION] [--dir DIR] [--debug] [--quality QUALITY] [--time TIME] [--range RANGE] url
1316
1417
Available actions:
15-
all - Download both video and audio, and merge them (default)
16-
live - Download the live stream only
18+
all - Download both video and audio (including live and backtracking), and then merge them (default)
19+
live - Download the live stream only (no backtracking)
1720
video - Download video only
1821
audio - Download audio only
1922
merge - Merge downloaded video and audio
20-
check - Check the downloaded segments to make sure there is no missing segments
21-
manual - Manually process a specified range (used together with --range)
23+
check - Check the downloaded segments to make sure there are no missing segments
24+
manual - Manually check missing segments at the largest gap (or use --range to assign a range) (for debugging only)
2225
info - Display downloader object info
2326
import:<path> - Import segments downloaded via N_m3u8DL-RE from a given path
2427
@@ -29,16 +32,21 @@ options:
2932
-h, --help show this help message and exit
3033
--action ACTION, -a ACTION
3134
action to perform (default: all)
32-
--dir DIR, -d DIR save path (default: CWD)
35+
--dir DIR, -d DIR save path (default: instalive_{mpd_id})
3336
--debug debug mode
3437
--quality QUALITY, -q QUALITY
35-
manually assign video quality (default: auto)
36-
--time TIME, -t TIME manually assign last t (default: auto)
37-
--range RANGE manually assign range (start,end) for quick iterate test mode
38+
manually assign video quality by quality name.
39+
(default: "pst": which is the "original" (?) and has the best bitrate,
40+
but not necessarily the highest resolution.
41+
Pass empty string or "highest" to use the highest resolution one.)
42+
--time TIME, -t TIME for debugging only; manually assign last t (default: auto)
43+
--range RANGE for debugging only; manually assign iteration range (start,end) for manual action
3844
```
3945

4046
## `oricon.py`
4147

48+
** Deprecated: You can no longer get original size of images from Oricon website AFAIK. The random quality toggling because of CDN is also gone (?). This can still be used to download the images in the size shown on the webpage, though. **
49+
4250
Quickly download all the highest quality pictures from any Oricon news, special or photo article.
4351

4452
Usage:
@@ -53,8 +61,6 @@ oricon.py https://www.oricon.co.jp/news/2236438/
5361

5462
Usage:
5563

56-
Note: make sure you also downloaded `util.py` file from the same directory.
57-
5864
CLI:
5965

6066
```
@@ -105,6 +111,8 @@ downloader.getPostPhotos(12345)
105111

106112
## `scraper_radiko.py`
107113

114+
** Deprecated: just use yt-dlp or even better, with [yt-dlp-rajiko](https://github.com/garret1317/yt-dlp-rajiko) plugin. **
115+
108116
Note: you need to prepare the JP proxy yourself.
109117

110118
Usage:
@@ -133,12 +141,16 @@ Also can download thumbnail from normal video. Downloading for normal video isn'
133141
pip install browser-cookie3 websocket-client rich python-dateutil pytz requests beautifulsoup4 lxml
134142
```
135143

136-
The actual downloading is delegated to [minyami](https://github.com/Last-Order/Minyami) and/or [N_m3u8DL-RE](https://github.com/nilaoda/N_m3u8DL-RE), so make sure you have them installed first.
144+
The actual downloading is delegated to [minyami](https://github.com/Last-Order/Minyami) and/or [N_m3u8DL-RE](https://github.com/nilaoda/N_m3u8DL-RE), so make sure you have them installed first and available in your PATH.
145+
146+
It also can reads the arguments from a `nico.txt` file in the CWD or the same directory as the script. Syntax: just put all the arguments in one line.
137147

138148
CLI:
139149

140150
```
141-
usage: nico.py [-h] [--verbose] [--info] [--dump] [--thumb] [--cookies COOKIES] [--comments {yes,no,only}] [--proxy PROXY] [--save-dir SAVE_DIR] [--reserve] url
151+
usage: nico.py [-h] [--verbose] [--info] [--dump] [--thumb] [--cookies COOKIES] [--comments {yes,no,only}] [--proxy PROXY] [--save-dir SAVE_DIR] [--reserve]
152+
[--simulate]
153+
url
142154
143155
positional arguments:
144156
url URL or ID of nicovideo webpage
@@ -161,6 +173,7 @@ options:
161173
--save-dir SAVE_DIR, -o SAVE_DIR
162174
Specify the directory to save the downloaded files. [Default: current directory]
163175
--reserve Automatically reserve timeshift ticket if not reserved yet. [Default: no]
176+
--simulate Simulate the download process without actually downloading.
164177
```
165178

166179
## `util.py`
@@ -169,8 +182,23 @@ Some utility functions mainly for myself. Read the code to get the idea.
169182

170183
Some highlights:
171184

172-
* download - a generic downloader
173-
* format_str - format a string to certain width and alignment. Supports wide characters like Chinese and Japanese.
174-
* compare_obj - recursively compare two objects.
175-
* Table - a simple table class.
176-
* parse_to_shortdate - parse a date string to a short date string ('%y%m%d'). Supports more East Asian language formats than `dateutil.parser`.
185+
**Network & Web Scraping:**
186+
* **download** - a comprehensive file downloader with retry logic, duplicate handling (skip/overwrite/rename), referer support, and automatic filename detection from URLs or response headers
187+
* **get** - a convenience wrapper around requests that returns a BeautifulSoup object with retry logic built-in
188+
* **requests_retry_session** - create a requests session with automatic retry on network failures
189+
* **load_cookie** - load cookies from browser (Chrome/Firefox/Edge), cookie files (Netscape format), or cookie strings
190+
191+
**File Operations:**
192+
* **safeify** - sanitize filenames by replacing illegal characters with full-width equivalents (yes I know safeify isn't a real word. It was blindly copied from another project and It was too much effort to change it)
193+
* **move_or_delete_duplicate** - move files with smart duplicate detection via hash comparison
194+
* **dump_json/load_json** - convenient JSON file I/O with proper encoding and formatting
195+
196+
**Data Structures & Formatting:**
197+
* **Table** - a simple table class with sorting, searching, filtering, and pretty printing capabilities
198+
* **format_str** - format a string to certain width and alignment. Supports wide characters like Chinese and Japanese
199+
* **compare_obj** - recursively compare two objects (dicts, lists, etc.) and print differences with rich formatting
200+
* **rprint** - print function using the rich library for colored and styled terminal output
201+
202+
**Date & Time:**
203+
* **MyTime** - a datetime wrapper that makes timezone conversions easy (local, JST, naive)
204+
* **parse_to_shortdate** - parse a date string to a short date string ('%y%m%d'). Supports more East Asian language formats than `dateutil.parser`

0 commit comments

Comments
 (0)