Skip to content

Commit

Permalink
Merge pull request #6 from aorinngoDo/develop/use-sheeta_utils
Browse files Browse the repository at this point in the history
develop/use-sheeta-utils
  • Loading branch information
aorinngoDo authored Dec 16, 2024
2 parents d9e2c80 + 0ab8ba0 commit 0986531
Show file tree
Hide file tree
Showing 7 changed files with 381 additions and 316 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Executable on push
on: [push, workflow_dispatch]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- name: Check-out repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: nicochannel_comment.py
mode: app

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} Build
path: |
build/*.exe
build/*.bin
include-hidden-files: true
183 changes: 179 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,179 @@
*
!/*.py
!/*.md
!/*.txt
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python

*test.py
*.json
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "sheeta_utils"]
path = sheeta_utils
url = https://github.com/aorinngoDo/sheeta_utils.git
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# nicochannel_comment

nicochannel.jp comment(s) downloader.
ニコニコチャンネルプラスからコメントをダウンロードし,各種ソフトで扱えるxmlファイルに変換します
nicochannel.jp (and sheeta) comment(s) downloader.
ニコニコチャンネルプラスなど sheeta 利用サイトからコメントをダウンロードし, 各種ソフトで扱えるxmlファイルに変換します.

## Usage/利用方法:
## Usage/利用方法

### 対話形式での操作、チャンネルの一括コメント保存に対応しました!
### 対話形式での操作

- オプションを指定せずとも利用しやすくなりました
- オプションを指定せずとも利用しやすくなりました

![image](https://github.com/aorinngoDo/nicochannel_comment/assets/90427309/906bb073-5e56-4dc5-a0d2-786919b5b998)

Expand All @@ -17,8 +17,12 @@ nicochannel.jp comment(s) downloader.

![image](https://github.com/aorinngoDo/nicochannel_comment/assets/90427309/b4b5f296-935e-4de9-990e-e719c6c93841)

### 非対話形式での操作

- `-b` オプションを指定することで, 対話画面をスキップできます. URLは引数で指定する必要があります. チャンネルURLを入力する場合に便利

```
usage: nicochannel_comment.py [-h] [-v] [-o OUTPUT] [--allow-broken-timestamp] [nico_url]
usage: nicochannel_comment.py [-h] [-v] [-o OUTPUT] [--allow-broken-timestamp] [-b] [nico_url]
nicochannel.jp comment(s) downloader.
Expand All @@ -31,24 +35,24 @@ options:
-o OUTPUT, --output OUTPUT
Output directory / filename.
--allow-broken-timestamp
Save comments that may have broken timestamps. It is recommended to add this option for videos
longer than 8 hours.
```
Save comments that may have broken timestamps. It is recommended to add this option for videos longer than 8 hours.
-b, --batch Non-interactive mode. If no output is specified in the argument, the default value is used.
```

video_url Example: ```https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB```
nico_url Example: ```https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB```

Example 1: [D:\Videos\] にコメントファイルを保存
``` nicochannel_comment.py https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB -o "D:\Videos\"```
```nicochannel_comment.py https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB -o "D:\Videos\"```
Example 2: カレントディレクトリ下にある[Videos]ディレクトリにファイル名を[comments.xml]としてコメントを全て保存
``` nicochannel_comment.py https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB -o "./Videos/comments.xml" --allowbrokentimestamp```

```nicochannel_comment.py https://nicochannel.jp/yojyo-bergamo/video/smvm4YYLRKyMreUq4sfjtawB -o "./Videos/comments.xml" --allowbrokentimestamp```

---
Tested on
```Windows 11 64bit Python 3.11.4```
```Ubuntu 22.04.2 LTS amd64 Python 3.10.6```
Requirements:

- Python 3.9 or later
- Check requirements.txt

## Bugs/不具合:
## Bugs/不具合

- サーバから送られるコメントファイルの一部の時間データがおかしい
確認できた限り,32000秒以降のコメントとして保存されているようなので無視するようにしている
Expand All @@ -67,6 +71,7 @@ Androidなら[ひま動ぷれいや](https://s368.web.fc2.com/)など
- Releasesのビルドについて
~20220412_fix: Pyinstallerを利用
20220505~: Nuitkaを利用

```shell-session
$ python -m nuitka --follow-imports --onefile nicochannel_comment.py
```
Expand Down
Loading

0 comments on commit 0986531

Please sign in to comment.