my-music-list/checkduplicate.py

19 lines
488 B
Python
Raw Normal View History

2024-10-05 04:48:49 -04:00
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)