my-music-list/checkduplicate.py
2024-10-05 08:48:49 +00:00

18 lines
488 B
Python

duplicate = []
with open("musiclist.txt", "r") as file:
lines = file.readlines()
for line in lines:
url = line.split("---")[1]
a = 0
for line2 in lines:
url2 = line2.split("---")[1]
if url == url2:
a += 1
if a >= 2:
if not line in duplicate:
duplicate.append(line)
else:
continue
for duplines in duplicate:
print(duplines)