<commit_before>package picast

import (
	"log"
	//"os"
	"os/exec"
	//"strconv"
	"os"
	"strings"
)

func YoutubeDl(entry PlaylistEntry) (string, error) {
	video_link_bytes, err := exec.Command("youtube-dl", "-g", entry.Url).Output()
	if err != nil {
		log.Println(err)
	}

	video_link := string(video_link_bytes[:])

	switch {
	case video_link == "":
		fallthrough
	case strings.Contains(video_link, "\n"):
		log.Println("Could not find video link")
		return "", os.ErrNotExist
	}

	return video_link, nil
}
<commit_msg>Fixed youtube-dl wrapper video link trailing newline bug<commit_after>package picast

import (
	"log"
	//"os"
	"os/exec"
	//"strconv"
	"os"
	//"strings"
)

func YoutubeDl(entry PlaylistEntry) (string, error) {
	video_link_bytes, err := exec.Command("youtube-dl", "-g", entry.Url).Output()
	if err != nil {
		log.Println(err)
	}

	video_link := string(video_link_bytes[:])

	switch {
	case video_link == "":
		log.Println("Could not find video link")
		return "", os.ErrNotExist
	}

	return video_link, nil
}

{'fraction_non_alphanumeric': 0.1626095423563778, 'fraction_numerical': 0.0, 'mean_word_length': 4.14, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '711497', 'n_tokens_mistral': 411, 'n_tokens_neox': 392, 'n_words': 87}