Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

안녕하세요. 건의 사항이 있어 요청드립니다 #2

Closed
Neoplanetz opened this issue Apr 15, 2019 · 3 comments
Closed

안녕하세요. 건의 사항이 있어 요청드립니다 #2

Neoplanetz opened this issue Apr 15, 2019 · 3 comments

Comments

@Neoplanetz
Copy link

올려주신 변환 코드 잘 사용하고있습니다. 감사드립니다.
다름이 아니라, 변환할때 변환이 안되는 파일들 중 일부 파일들은 변환하다가 변환이 안되는지 무한 대기에 걸리는 상황이 발생하더군요. 몇몇 변환 안되는 파일은 넘어가는것도 있는데, 일부는 그 파일에서 멈춰버려서 더이상 진행이 안되서 Ctrl+C로 강제로 그 파일 취소해줘야 다음 파일로 넘어가더군요. 요것이 해결되었으면 좋겠구요.
다른건 추가로 건의 사항이 있어서 말씀드립니다. 현재 설정한 파일안에 smi파일이 있으면 무조건 변환되는 방식인데 혹시 그 폴더안에 srt파일이 있으면 변환 Skip이 가능하도록 변경이 가능할까요?
매번 해보니 저같은경우는 혹시 몰라서 원본 smi파일은 지우지 않는데, 그렇게하니 매번 smi파일을 srt로 변환하더군요. Skip 이 가능해지면 더욱 편리하게 사용할수 있을것 같습니다 ^^

@ncianeo
Copy link
Owner

ncianeo commented Apr 18, 2019

  1. 폴더 내에 srt확장자가 있는 경우 변환 skip이 되도록 하는 기능을 추가해보겠습니다
  2. 변환중 멈춰버리는 파일 예를 메일로 보내주실 수 있을까요?

@bulzipke
Copy link

bulzipke commented Apr 26, 2019

2번의 경우에는 자막에 p 태그가 없을 때 확인됩니다.
에러 자막 예시 : https://cloud.bulzipke.com/s/Yzt64CwLqWdPsow
split_content 메서드에서 아래와 같이 표준화(?)를 해줘서 우회 할 수 있긴 한데 원하시는 방법은 아닐 것 같네요.

def split_content(string, tag):
    threshold = '<'+tag

    if tag is 'p':
        standard = threshold + ' Class=' + LANG + '>'
        if standard.upper() not in string.upper():
            idx = string.find('>') + 1
            string = string[:idx] + standard + string[idx:]

    return list(map(
        lambda item: (threshold+item).strip(),
        re.split(threshold, string, flags=re.I)
    ))[1:]

유익한 프로젝트 감사드립니다 :)

@ncianeo
Copy link
Owner

ncianeo commented May 2, 2019

Bulzipke 님의 방법을 참고하겠습니다
근데 배포되는 smi 파일들이 표준이 없이 너무 난잡해서... 최종버전이라는게 있을 수 없을 것 같다는 생각이 드네요 ㅋㅋㅋ
혹여 모를 다른 오류로 진행이 멈춰버리는 상황을 방지하기 위해 멀티 프로세싱과 타임아웃 처리도 도입해봐야겠네요

@ncianeo ncianeo closed this as completed May 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants