aryu44 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aryu44/__init__.py +1 -0
- aryu44/help.py +18 -0
- aryu44/move/__init__.py +1 -0
- aryu44/move/git.py +18 -0
- aryu44/word/__init__.py +4 -0
- aryu44/word/copy.py +16 -0
- aryu44/word/info.py +35 -0
- aryu44/yt.py +32 -0
- aryu44-0.2.0.dist-info/METADATA +6 -0
- aryu44-0.2.0.dist-info/RECORD +12 -0
- aryu44-0.2.0.dist-info/WHEEL +5 -0
- aryu44-0.2.0.dist-info/top_level.txt +1 -0
aryu44/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import yt
|
aryu44/help.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
def help(select):
|
|
2
|
+
menu_dict = {
|
|
3
|
+
"yt": "youtubeの動画をダウンロードする",
|
|
4
|
+
"mv": "word-dict-{version}.debのファイルを移動させます",
|
|
5
|
+
"help": "ヘルプメニューを出します",
|
|
6
|
+
"word": "単語数を調べます",
|
|
7
|
+
"cope": "単語数のtxtを上書きします"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
for menu, ex in menu_dict.items():
|
|
11
|
+
if not(select):
|
|
12
|
+
print(f"{menu}: {ex}")
|
|
13
|
+
elif menu == select:
|
|
14
|
+
print(f"{menu}: {ex}")
|
|
15
|
+
|
|
16
|
+
if __name__ == "__main__":
|
|
17
|
+
menu = input("ヘルプメニューを選択してください: ")
|
|
18
|
+
help(select=menu)
|
aryu44/move/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from . import git
|
aryu44/move/git.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
def git_move(version):
|
|
6
|
+
deb = "/home/asano12300/word/word-dict-" + version + ".deb"
|
|
7
|
+
to_move = "/home/asano12300/gitproject/" + version
|
|
8
|
+
move = "/home/asano12300/gitproject"
|
|
9
|
+
mv_deb = "/home/asano12300/gitproject/word-dict-" + version + ".deb"
|
|
10
|
+
|
|
11
|
+
if os.path.exists(deb):
|
|
12
|
+
shutil.move(deb, move)
|
|
13
|
+
|
|
14
|
+
os.chdir("/home/asano12300/gitproject")
|
|
15
|
+
os.mkdir(version)
|
|
16
|
+
shutil.move(mv_deb, version)
|
|
17
|
+
else:
|
|
18
|
+
print("ファイルが存在しません")
|
aryu44/word/__init__.py
ADDED
aryu44/word/copy.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
def main():
|
|
5
|
+
word = "/home/asano12300/word/data/dictionary.json"
|
|
6
|
+
txt = "/home/asano12300/gitproject/word_data.txt"
|
|
7
|
+
|
|
8
|
+
#JSONファイルの読み込み
|
|
9
|
+
with open(word, 'r', encoding='utf-8') as f:
|
|
10
|
+
data = json.load(f)
|
|
11
|
+
|
|
12
|
+
# TXTファイルへの書き出し
|
|
13
|
+
with open(txt, 'w', encoding='utf-8') as f:
|
|
14
|
+
json.dump(data, f, indent=4, ensure_ascii=False, sort_keys=True)
|
|
15
|
+
|
|
16
|
+
print("抽出完了しました")
|
aryu44/word/info.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
word = "/home/asano12300/.config/word-dict/dictionary.json"
|
|
5
|
+
|
|
6
|
+
def main(select):
|
|
7
|
+
load_json(select)
|
|
8
|
+
|
|
9
|
+
def load_json(select):
|
|
10
|
+
word = "/home/asano12300/.config/word-dict/dictionary.json"
|
|
11
|
+
dict = "/home/asano12300/word/data/dictionary.json"
|
|
12
|
+
|
|
13
|
+
if os.path.exists(word):
|
|
14
|
+
if select == "1":
|
|
15
|
+
with open(dict, 'r', encoding='utf-8') as f:
|
|
16
|
+
now_dict = json.load(f)
|
|
17
|
+
if select == "1":
|
|
18
|
+
ex_word = len(now_dict)
|
|
19
|
+
print(f"単語数: {ex_word}")
|
|
20
|
+
elif select == "2" or select == "3":
|
|
21
|
+
with open(word, 'r', encoding='utf-8') as f:
|
|
22
|
+
now_dict = json.load(f)
|
|
23
|
+
if select == "2":
|
|
24
|
+
now_word = len(now_dict)
|
|
25
|
+
print(f"単語数: {now_word}")
|
|
26
|
+
elif select == "3":
|
|
27
|
+
search = input("検索した単語: ")
|
|
28
|
+
for word, ex in now_dict.items():
|
|
29
|
+
if word == search:
|
|
30
|
+
print(f"{word}の意味: {ex}")
|
|
31
|
+
else:
|
|
32
|
+
print("Error: 選択が無効です")
|
|
33
|
+
else:
|
|
34
|
+
print("インストールされていません")
|
|
35
|
+
|
aryu44/yt.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import yt_dlp
|
|
2
|
+
|
|
3
|
+
def down_video(video_url):
|
|
4
|
+
ydl_opts = {
|
|
5
|
+
# 'bestvideo+bestaudio' で最高画質の映像と最高音質の音声を別々に取得し、
|
|
6
|
+
# 'best' でそれらが結合できない場合のフォールバックを指定
|
|
7
|
+
'format': 'bestvideo+bestaudio/best',
|
|
8
|
+
|
|
9
|
+
# 保存するファイル名(動画タイトル.拡張子)
|
|
10
|
+
'outtmpl': '%(title)s.%(ext)s',
|
|
11
|
+
|
|
12
|
+
# ffmpegを使って、動画を最終的に mp4 形式に美しく結合する設定
|
|
13
|
+
'merge_output_format': 'mp4',
|
|
14
|
+
|
|
15
|
+
# 進行状況などのログを出力する設定(任意)
|
|
16
|
+
'quiet': False,
|
|
17
|
+
'no_warnings': False,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
print("ffmpegと連携して最高画質でのダウンロードを開始します...")
|
|
22
|
+
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
|
23
|
+
ydl.download([video_url])
|
|
24
|
+
print("\nダウンロードと動画の結合が完了しました!")
|
|
25
|
+
|
|
26
|
+
except Exception as e:
|
|
27
|
+
print(f"\nエラーが発生しました: {e}")
|
|
28
|
+
print("※ffmpegが正しくインストールされているか確認してください。")
|
|
29
|
+
|
|
30
|
+
if __name__ == "__main__":
|
|
31
|
+
url = input("YouTubeの動画URLを入力してください: ")
|
|
32
|
+
download_video(url)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
aryu44/__init__.py,sha256=SOysdVf0VuZ5u6PTOUBNfgL7fNdM_zq3g2L4TSRG14M,16
|
|
2
|
+
aryu44/help.py,sha256=N-CwfZ7qxV4DaJFJn34CU_EqT8D-mVpUNTRqR6_z23g,622
|
|
3
|
+
aryu44/yt.py,sha256=g0_gG1R3cFN_hlaxDIKhh3kdd3U85bWzFqPVGir7TKY,1293
|
|
4
|
+
aryu44/move/__init__.py,sha256=Fzvc_jh0zPW5PR2U93a55oM8ze45PuvAs6KZ36Rloas,17
|
|
5
|
+
aryu44/move/git.py,sha256=drzBVjCE0LGI-jE1ofTcbAEfK2ZD73jfj_Rp0LJ_0Os,558
|
|
6
|
+
aryu44/word/__init__.py,sha256=uOZBnGtX-pb2DWrqkE65tqavJz7F7nmcLhZRAyJtej0,40
|
|
7
|
+
aryu44/word/copy.py,sha256=DP1nRtfwXOLJgElyZOwPH1JfpwzYSjmurH8UAABSt1o,464
|
|
8
|
+
aryu44/word/info.py,sha256=iQYgYsBIfsnbq206_SCz3cEmeOO1MfNkRSAJNYgnDQ0,1227
|
|
9
|
+
aryu44-0.2.0.dist-info/METADATA,sha256=s4Qz2a0-WAnwslxhFGVEX3LeYJB1n_1oLWT2s3hfWiw,135
|
|
10
|
+
aryu44-0.2.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
11
|
+
aryu44-0.2.0.dist-info/top_level.txt,sha256=x1fnnZomaWK7oMY7c6rXpimZF3X0kmpfIu-JQPHX-5s,7
|
|
12
|
+
aryu44-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aryu44
|