# Buggy code
def run_subs_extra_scripts(
    video_path,
    subtitle_path,
    subtitle_language,
    show_name,
    season,
    episode,
    episode_name,
    show_indexerid,
):
    """Executes the subtitles extra-scripts for the given video path

    :param video_path: the video path
    :type video_path: str
    :param subtitle_path: the downloaded subtitle path
    :type subtitle_path: str
    :param subtitle_language: the subtitle language
    :type subtitle_language: babelfish.Language
    :param show_name: the show name
    :type show_name: str
    :param season: the episode season number
    :type season: int
    :param episode: the episode number
    :type episode: int
    :param episode_name: the episode name
    :type episode_name: str
    :param show_indexerid: the show indexer id
    :type show_indexerid: int
    """
    run_subs_scripts(
        video_path,
        sickbeard.SUBTITLES_EXTRA_SCRIPTS,
        [
            video_path,
            subtitle_path,
            subtitle_language.opensubtitles,
            show_name,
            str(season),
            str(episode),
            episode_name,
            str(show_indexerid),
        ],
    )


# Traceback (UnicodeEncodeError)
FINDSUBTITLES :: [d47493d] Traceback (most recent call last):
File "/home/home/SickRage/sickbeard/subtitles.py", line 338, in download_best_subs
save_subtitles(video, found_subtitles, directory=subtitles_dir, single=not sickbeard.SUBTITLES_MULTI)
File "/home/home/SickRage/lib/subliminal/core.py", line 695, in save_subtitles
with io.open(subtitle_path, 'wb') as f:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in position 93: ordinal not in range(128)
Traceback (most recent call last):
File "/home/home/SickRage/sickbeard/subtitles.py", line 338, in download_best_subs
save_subtitles(video, found_subtitles, directory=subtitles_dir, single=not sickbeard.SUBTITLES_MULTI)
File "/home/home/SickRage/lib/subliminal/core.py", line 695, in save_subtitles
with io.open(subtitle_path, 'wb') as f:
UnicodeEncodeError: 'ascii' codec can't encode character u'\xea' in position 93: ordinal not in range(128)

# Fixed code
def run_subs_extra_scripts(
    video_path,
    subtitle_path,
    subtitle_language,
    show_name,
    season,
    episode,
    episode_name,
    show_indexerid,
):
    """Execute the subtitles extra-scripts for the given video path.

    :param video_path: the video path
    :type video_path: str
    :param subtitle_path: the downloaded subtitle path
    :type subtitle_path: str
    :param subtitle_language: the subtitle language
    :type subtitle_language: babelfish.Language
    :param show_name: the show name
    :type show_name: str
    :param season: the episode season number
    :type season: int
    :param episode: the episode number
    :type episode: int
    :param episode_name: the episode name
    :type episode_name: str
    :param show_indexerid: the show indexer id
    :type show_indexerid: int
    """
    run_subs_scripts(
        video_path,
        sickbeard.SUBTITLES_EXTRA_SCRIPTS,
        [
            video_path,
            subtitle_path,
            subtitle_language.opensubtitles,
            show_name,
            season,
            episode,
            episode_name,
            show_indexerid,
        ],
    )