import time
import numpy as np
from numba import jit
# 通常のPython関数defsum_array(arr):
total =0for i in arr:
total += i
return total
# Numbaを使用した関数
@jit(nopython=True)defsum_array_numba(arr):
total =0for i in arr:
total += i
return total
# 配列の準備
array_size =10**7
arr = np.random.rand(array_size)# 通常のPython関数の実行時間を計測
start_time = time.time()
sum_array(arr)
end_time = time.time()print(f"通常のPython関数の実行時間: {end_time - start_time} 秒")# Numbaを使用した関数の実行時間を計測
start_time = time.time()
sum_array_numba(arr)
end_time = time.time()print(f"Numbaを使用した関数の実行時間: {end_time - start_time} 秒")
(unattended-upgrade) Could not figure out development release: Distribution data outdated. Please check for an update for distro-info-data. See usr share doc distro-info-data README.Debian for details.
2024-10-22 04:15:36 ERR YouTube search failed. device="ファミリー ルーム 2" error="googleapi: Error 403: The request cannot be completed because you have exceeded your <a href=\"/youtube/v3/getting-started#quota\">quota</a>., quotaExceeded"
ログ
正常動作時のログになります
2024-10-22 05:31:34 INF CastSponsorSkip version=v0.8.0 commit=9e65ac39
2024-10-22 05:31:34 INF Searching for devices...
2024-10-22 05:31:34 INF Connected to cast device. device="ファミリー ルーム 2"
2024-10-22 05:32:04 INF Video ID not set. Searching YouTube for video ID... device="ファミリー ルーム 2"
2024-10-22 05:32:05 INF Detected video stream. device="ファミリー ルーム 2" video_id=xxx
2024-10-22 05:32:05 INF No segments found for video. device="ファミリー ルーム 2" video_id=xxx
最後に
Android TV for Chromecast の場合には YOUTUBE_API_KEY が必要になるようです
ペアリングなどもここで行います
なお Chromecast with GoogleTV に接続する場合自動で検出してくれないので一度 Chromecast with GoogleTV で Youtube アプリを開き
設定 -> テレビコードでリンク
で RaspberryPi とペアリングするためのコードを表示しておきす
docker run --rm -it -v $(pwd)/data:/app/data ghcr.io/dmunozv04/isponsorblocktv --setup-cli
各種設定項目は以下の通りです
123456789012 の部分は Chromecast with GoogleTV に表示されている番号を入力してください
Could not load config file
Blank config file created
Welcome to the iSponsorBlockTV cli setup wizard
Paired with 0 Device(s). Add more? (y/N) y
Enter pairing code (found in Settings - Link with TV code): 123456789012
Pairing...
Paired device: YouTube on TV
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fff87e87190>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7fff87e41b70>, 10237.691475742)]']
connector: <aiohttp.connector.TCPConnector object at 0x7fff87e86f90>
Paired with 1 Device(s). Add more? (y/N) N
API key only needed for the channel whitelist function. Add it? (y/N) N
Enter skip categories (space or comma sepparated) Options: [sponsor, selfpromo, exclusive_access, interaction, poi_highlight, intro, outro, preview, filler, music_offtopic]:
sponsor, selfpromo, exclusive_access, interaction, poi_highlight, intro, outro, preview, filler, music_offtopic
Do you want to whitelist any channels from being ad-blocked? (y/N) N
Do you want to report skipped segments to sponsorblock. Only the segment UUID will be sent? (Y/n) n
Do you want to mute native YouTube ads automatically? (y/N) y
Do you want to skip native YouTube ads automatically? (y/N) y
Do you want to enable autoplay? (Y/n) Y
Config finished
iSponsorBlockTV | 2024-10-22 06:25:46,392 - iSponsorBlockTV-xxx - INFO - Starting device
iSponsorBlockTV | Unclosed client session
iSponsorBlockTV | client_session: <aiohttp.client.ClientSession object at 0x7fff7f9f33d0>
iSponsorBlockTV | 2024-10-22 06:25:46,531 - iSponsorBlockTV-xxx - INFO - Refreshed auth, lounge id token AGdxxx
iSponsorBlockTV | 2024-10-22 06:25:46,991 - iSponsorBlockTV-xxx - INFO - Connected to device YouTube on TV (YouTube on TV)
iSponsorBlockTV | 2024-10-22 06:25:46,991 - iSponsorBlockTV-xxx - INFO - Subscribing to lounge
iSponsorBlockTV | 2024-10-22 06:25:46,994 - iSponsorBlockTV-xxx - INFO - Subscribing to lounge id AGdxxx
iSponsorBlockTV | 2024-10-22 06:26:17,875 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:17,878 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:17,879 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:18,975 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:19,749 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:33,071 - iSponsorBlockTV-xxx - INFO - Ad has ended, unmuting
iSponsorBlockTV | 2024-10-22 06:26:33,827 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:33,827 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:33,828 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:39,983 - iSponsorBlockTV-xxx - INFO - Ad has ended, unmuting
iSponsorBlockTV | 2024-10-22 06:26:40,454 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:40,455 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:40,456 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:45,501 - iSponsorBlockTV-xxx - INFO - Ad can be skipped, skipping
iSponsorBlockTV | 2024-10-22 06:26:46,049 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:46,797 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:46,798 - iSponsorBlockTV-xxx - INFO - Getting segments for next video: xxx
iSponsorBlockTV | 2024-10-22 06:26:46,799 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:51,823 - iSponsorBlockTV-xxx - INFO - Ad can be skipped, skipping
iSponsorBlockTV | 2024-10-22 06:26:52,169 - iSponsorBlockTV-xxx - INFO - Ad has started, muting
iSponsorBlockTV | 2024-10-22 06:26:55,607 - iSponsorBlockTV-xxx - INFO - Playing video xxx with 0 segments
environment に MODE=creative を追加します
すでにワールドがある場合には再度ワールドを作成し直します
docker の場合は data ディレクトリを作成し直せば OK です
前のワールドを残したい場合はディレクトリをリネームしておきましょう
services:mc:image: itzg/minecraft-server
tty:truestdin_open:trueports:-"25565:25565"environment:EULA:"TRUE"MODE:"creative"volumes:# attach the relative directory 'data' to the container's /data path- ./data:/data