018 019 020 zu mp3
This commit is contained in:
@@ -1,48 +1,87 @@
|
||||
import json
|
||||
import uuid
|
||||
import hashlib
|
||||
|
||||
with open('deck.json', 'r', encoding='utf-8') as f:
|
||||
|
||||
base91chars = (
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'
|
||||
'0123456789!#$%&()*+,-./:;<=>?@[]^_`{|}~'
|
||||
)
|
||||
|
||||
def anki_guid(text: str) -> str:
|
||||
# SHA1-Hash des Front-Felds berechnen
|
||||
h = hashlib.sha1(text.encode('utf-8')).digest()
|
||||
x = int.from_bytes(h[:8], 'little') # Anki nimmt die ersten 8 Bytes, little-endian
|
||||
|
||||
# Kodierung in Base91-Zeichenkette (10 Zeichen)
|
||||
chars = []
|
||||
for _ in range(10):
|
||||
chars.append(base91chars[x % len(base91chars)])
|
||||
x //= len(base91chars)
|
||||
|
||||
return ''.join(chars)
|
||||
|
||||
with open('Schwedisch_Goetheverlag/deck.json', 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
|
||||
original_notes = data['notes']
|
||||
new_notes = []
|
||||
existing_signatures = set()
|
||||
|
||||
def signature(front0, front1, back):
|
||||
return f"{front0}||{front1}||{back}"
|
||||
existing__notemodels = []
|
||||
for i in data['note_models']:
|
||||
existing__notemodels.append(i['crowdanki_uuid'])
|
||||
|
||||
for note in original_notes:
|
||||
fields = note['fields']
|
||||
note_model_uuid = note['note_model_uuid']
|
||||
if len(fields) < 3:
|
||||
continue
|
||||
|
||||
original_front = fields[0] # "ich"
|
||||
original_back = fields[1] # "jag"
|
||||
original_audio = fields[2] # "[sound:Jag-4718d0.mp3]"
|
||||
original_back_audio = fields[2] # "[sound:Jag-4718d0.mp3]"
|
||||
original_front_uuid = note_model_uuid
|
||||
new_uuid = None
|
||||
new_note = None
|
||||
|
||||
sig = signature(original_front, original_audio, original_back)
|
||||
reversed_sig = signature(original_back, original_audio, original_front)
|
||||
if original_front_uuid == existing__notemodels[0]:
|
||||
# Original:
|
||||
# Deutsch (Front)
|
||||
# Sverige (Back)
|
||||
# Audio (Backaudio)
|
||||
# Neu:
|
||||
# Sverige (Front)
|
||||
# Audio (Frontaudio)
|
||||
# Deutsch (Back)
|
||||
|
||||
if note['guid'].startswith('rev-') or reversed_sig in existing_signatures:
|
||||
continue
|
||||
new_note = {
|
||||
"__type__": "Note",
|
||||
"fields": [
|
||||
original_back,
|
||||
original_back_audio,
|
||||
original_front
|
||||
],
|
||||
"guid": f"{anki_guid(original_back)}",
|
||||
"note_model_uuid": existing__notemodels[1],
|
||||
"tags": []
|
||||
}
|
||||
new_notes.append(new_note)
|
||||
|
||||
new_note = {
|
||||
"__type__": "Note",
|
||||
"fields": [
|
||||
original_back, # Feld 0: Frage Text (Antwort aus Original)
|
||||
original_audio, # Feld 1: Frage Audio (MP3 aus Original)
|
||||
original_front # Feld 2: Antwort Text (Frage aus Original)
|
||||
],
|
||||
"guid": f"rev-{uuid.uuid4()}",
|
||||
"note_model_uuid": note["note_model_uuid"],
|
||||
"tags": note.get("tags", []) + ["reversed"]
|
||||
}
|
||||
# new_note = {
|
||||
# "__type__": "Note",
|
||||
# "fields": [
|
||||
# original_front,
|
||||
# original_front_audio,
|
||||
# original_back
|
||||
# ],
|
||||
# "guid": f"{anki_guid(original_front)}",
|
||||
# "note_model_uuid": note_model_uuid[1]
|
||||
# }
|
||||
# new_notes.append(new_note)
|
||||
# print(new_note
|
||||
|
||||
new_notes.append(new_note)
|
||||
existing_signatures.add(sig)
|
||||
existing_signatures.add(reversed_sig)
|
||||
|
||||
data['notes'].extend(new_notes)
|
||||
|
||||
with open('crowdanki_export_dupliziert.json', 'w', encoding='utf-8') as f:
|
||||
with open('Schwedisch_Goetheverlag/crowdanki_export_dupliziert.json', 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
@@ -1,4 +1,4 @@
|
||||
import hashlib, uuid, random, string
|
||||
import hashlib, uuid, random, string, sys
|
||||
|
||||
def anki_guid1(text: str) -> str:
|
||||
#return hashlib.sha1(text.encode('utf-8')).hexdigest()[:10]
|
||||
@@ -35,4 +35,4 @@ def anki_guid(text: str) -> str:
|
||||
return ''.join(chars)
|
||||
|
||||
|
||||
print(anki_guid("ich und du"))
|
||||
print(anki_guid(sys.argv[1]))
|
||||
|
||||
Binary file not shown.
BIN
GoetheVerlag/mp3/018/barnen_städar_barnkammaren.mp3
Normal file
BIN
GoetheVerlag/mp3/018/barnen_städar_barnkammaren.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/barnen_tvättar_cyklarna.mp3
Normal file
BIN
GoetheVerlag/mp3/018/barnen_tvättar_cyklarna.mp3
Normal file
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# coding=utf-8
|
||||
from pydub import AudioSegment
|
||||
import sys,os
|
||||
|
||||
def convert(wav):
|
||||
# Lade die WAV-Datei
|
||||
audio = AudioSegment.from_wav(wav)
|
||||
|
||||
print(wav)
|
||||
|
||||
output = os.path.splitext(wav)[0]
|
||||
outputname = output+".mp3"
|
||||
# print(outputname)
|
||||
|
||||
# Speichere sie als MP3 (z.B. mit einer Bitrate von 192 kbps)
|
||||
audio.export(outputname, format="mp3", bitrate="192k")
|
||||
|
||||
print("Konvertierung abgeschlossen!")
|
||||
|
||||
convert(sys.argv[1])
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(ls *.wav)
|
||||
do
|
||||
python3 convert.py $i
|
||||
echo $i
|
||||
rm -f $i
|
||||
done
|
||||
|
||||
BIN
GoetheVerlag/mp3/018/farmor_mormor_vattnar_blommorna.mp3
Normal file
BIN
GoetheVerlag/mp3/018/farmor_mormor_vattnar_blommorna.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/fönstren_är_smutsiga.mp3
Normal file
BIN
GoetheVerlag/mp3/018/fönstren_är_smutsiga.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/golvet_är_smutsigt.mp3
Normal file
BIN
GoetheVerlag/mp3/018/golvet_är_smutsigt.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/idag_har_vi_tid.mp3
Normal file
BIN
GoetheVerlag/mp3/018/idag_har_vi_tid.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/idag_städar_vi_lägenheten.mp3
Normal file
BIN
GoetheVerlag/mp3/018/idag_städar_vi_lägenheten.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/idag_är_det_lördag.mp3
Normal file
BIN
GoetheVerlag/mp3/018/idag_är_det_lördag.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/jag_hänger_upp_tvätten.mp3
Normal file
BIN
GoetheVerlag/mp3/018/jag_hänger_upp_tvätten.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/jag_lägger_tvätten_i_tvättmaskinen.mp3
Normal file
BIN
GoetheVerlag/mp3/018/jag_lägger_tvätten_i_tvättmaskinen.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/jag_stryker_tvätten.mp3
Normal file
BIN
GoetheVerlag/mp3/018/jag_stryker_tvätten.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/jag_städar_badrummet.mp3
Normal file
BIN
GoetheVerlag/mp3/018/jag_städar_badrummet.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/min_man_städar_sitt_skrivbord.mp3
Normal file
BIN
GoetheVerlag/mp3/018/min_man_städar_sitt_skrivbord.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/min_man_tvättar_bilen.mp3
Normal file
BIN
GoetheVerlag/mp3/018/min_man_tvättar_bilen.mp3
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# coding=utf-8
|
||||
from pydub import AudioSegment
|
||||
import sys,os
|
||||
|
||||
def convert(wav):
|
||||
# Lade die WAV-Datei
|
||||
audio = AudioSegment.from_wav(wav)
|
||||
|
||||
print(wav)
|
||||
|
||||
output = os.path.splitext(wav)[0]
|
||||
outputname = output+".mp3"
|
||||
# print(outputname)
|
||||
|
||||
# Speichere sie als MP3 (z.B. mit einer Bitrate von 192 kbps)
|
||||
audio.export(outputname, format="mp3", bitrate="192k")
|
||||
|
||||
print("Konvertierung abgeschlossen!")
|
||||
|
||||
convert(sys.argv[1])
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(ls *.wav)
|
||||
do
|
||||
python3 convert.py $i
|
||||
echo $i
|
||||
rm -f $i
|
||||
done
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
GoetheVerlag/mp3/018/porslinet_är_smutsigt.mp3
Normal file
BIN
GoetheVerlag/mp3/018/porslinet_är_smutsigt.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/vem_dammsuger.mp3
Normal file
BIN
GoetheVerlag/mp3/018/vem_dammsuger.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/vem_diskar.mp3
Normal file
BIN
GoetheVerlag/mp3/018/vem_diskar.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/018/vem_putsar_fönstren_vem_dammsuger.mp3
Normal file
BIN
GoetheVerlag/mp3/018/vem_putsar_fönstren_vem_dammsuger.mp3
Normal file
Binary file not shown.
Binary file not shown.
BIN
GoetheVerlag/mp3/019/har_du_en_flasköppnare.mp3
Normal file
BIN
GoetheVerlag/mp3/019/har_du_en_flasköppnare.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/har_du_en_konservöppnare.mp3
Normal file
BIN
GoetheVerlag/mp3/019/har_du_en_konservöppnare.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/har_du_en_korkskruv.mp3
Normal file
BIN
GoetheVerlag/mp3/019/har_du_en_korkskruv.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/har_du_ett_nytt_kök.mp3
Normal file
BIN
GoetheVerlag/mp3/019/har_du_ett_nytt_kök.mp3
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
GoetheVerlag/mp3/019/ja_dukar_bordet.mp3
Normal file
BIN
GoetheVerlag/mp3/019/ja_dukar_bordet.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/kokar_du_soppan_i_den_här_kastrullen.mp3
Normal file
BIN
GoetheVerlag/mp3/019/kokar_du_soppan_i_den_här_kastrullen.mp3
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# coding=utf-8
|
||||
from pydub import AudioSegment
|
||||
import sys,os
|
||||
|
||||
def convert(wav):
|
||||
# Lade die WAV-Datei
|
||||
audio = AudioSegment.from_wav(wav)
|
||||
|
||||
print(wav)
|
||||
|
||||
output = os.path.splitext(wav)[0]
|
||||
outputname = output+".mp3"
|
||||
# print(outputname)
|
||||
|
||||
# Speichere sie als MP3 (z.B. mit einer Bitrate von 192 kbps)
|
||||
audio.export(outputname, format="mp3", bitrate="192k")
|
||||
|
||||
print("Konvertierung abgeschlossen!")
|
||||
|
||||
convert(sys.argv[1])
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(ls *.wav)
|
||||
do
|
||||
python3 convert.py $i
|
||||
echo $i
|
||||
rm -f $i
|
||||
done
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
GoetheVerlag/mp3/019/ska_jag_skala_potatisen.mp3
Normal file
BIN
GoetheVerlag/mp3/019/ska_jag_skala_potatisen.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/ska_jag_skära_löken.mp3
Normal file
BIN
GoetheVerlag/mp3/019/ska_jag_skära_löken.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/ska_jag_skölja_salladen.mp3
Normal file
BIN
GoetheVerlag/mp3/019/ska_jag_skölja_salladen.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/steker_du_fisken_i_den_här_stekpannan.mp3
Normal file
BIN
GoetheVerlag/mp3/019/steker_du_fisken_i_den_här_stekpannan.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/vad_vill_du_laga_för_mat_idag.mp3
Normal file
BIN
GoetheVerlag/mp3/019/vad_vill_du_laga_för_mat_idag.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/var_är_besticken.mp3
Normal file
BIN
GoetheVerlag/mp3/019/var_är_besticken.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/var_är_glasen.mp3
Normal file
BIN
GoetheVerlag/mp3/019/var_är_glasen.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/019/var_är_porselinet.mp3
Normal file
BIN
GoetheVerlag/mp3/019/var_är_porselinet.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/har_ni_barn.mp3
Normal file
BIN
GoetheVerlag/mp3/020/har_ni_barn.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/har_ni_en_hund.mp3
Normal file
BIN
GoetheVerlag/mp3/020/har_ni_en_hund.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/har_ni_en_katt.mp3
Normal file
BIN
GoetheVerlag/mp3/020/har_ni_en_katt.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/här_är_min_gitarr.mp3
Normal file
BIN
GoetheVerlag/mp3/020/här_är_min_gitarr.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/här_är_mina_böcker.mp3
Normal file
BIN
GoetheVerlag/mp3/020/här_är_mina_böcker.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/här_är_mina_cdskivor.mp3
Normal file
BIN
GoetheVerlag/mp3/020/här_är_mina_cdskivor.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/jag_läser_just_nu_den_här_boken.mp3
Normal file
BIN
GoetheVerlag/mp3/020/jag_läser_just_nu_den_här_boken.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/jag_tycker_om_klassisk_musik.mp3
Normal file
BIN
GoetheVerlag/mp3/020/jag_tycker_om_klassisk_musik.mp3
Normal file
Binary file not shown.
BIN
GoetheVerlag/mp3/020/känn_er_som_hemma.mp3
Normal file
BIN
GoetheVerlag/mp3/020/känn_er_som_hemma.mp3
Normal file
Binary file not shown.
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
# coding=utf-8
|
||||
from pydub import AudioSegment
|
||||
import sys,os
|
||||
|
||||
def convert(wav):
|
||||
# Lade die WAV-Datei
|
||||
audio = AudioSegment.from_wav(wav)
|
||||
|
||||
print(wav)
|
||||
|
||||
output = os.path.splitext(wav)[0]
|
||||
outputname = output+".mp3"
|
||||
# print(outputname)
|
||||
|
||||
# Speichere sie als MP3 (z.B. mit einer Bitrate von 192 kbps)
|
||||
audio.export(outputname, format="mp3", bitrate="192k")
|
||||
|
||||
print("Konvertierung abgeschlossen!")
|
||||
|
||||
convert(sys.argv[1])
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(ls *.wav)
|
||||
do
|
||||
python3 convert.py $i
|
||||
echo $i
|
||||
rm -f $i
|
||||
done
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user