<commit_before>var Client = require('castv2-client').Client
var DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver
var mdns = require('mdns')
var peerflix = require('peerflix')
var network = require('network-address')
var events = require('events')

module.exports = function(torrent, opts) {
  if (!opts) opts = {}

  if (!opts.type) {
    opts.type = function() {
      return 'video/mp4'
    }
  }

  var engine = peerflix(torrent, opts)
  var browser = mdns.createBrowser(mdns.tcp('googlecast'))

  browser.on('serviceUp', function(service) {
    var host = service.addresses[0]
    var client = new Client()

    engine.server.on('listening', function() {
      var addr = 'http://'+network()+':'+engine.server.address().port

      client.connect(host, function(err) {<commit_msg>Add exit message<commit_after>var Client = require('castv2-client').Client
var DefaultMediaReceiver = require('castv2-client').DefaultMediaReceiver
var mdns = require('mdns')
var peerflix = require('peerflix')
var network = require('network-address')
var events = require('events')

process.on('SIGINT', function() {
  // we're doing some heavy lifting so it can take some time to exit... let's
  // better output a status message so the user knows we're working on it :)
  console.log('\nPeercast is exiting...')
  process.exit()
})

module.exports = function(torrent, opts) {
  if (!opts) opts = {}

  if (!opts.type) {
    opts.type = function() {
      return 'video/mp4'
    }
  }

  var engine = peerflix(torrent, opts)
  var browser = mdns.createBrowser(mdns.tcp('googlecast'))

  browser.on('serviceUp', function(service) {
    var host = service.addresses[0]
    var client = new Client()

    engine.server.on('listening', function() {
      var addr = 'http://'+network()+':'+engine.server.address().port

      client.connect(host, function(err) {
{'fraction_non_alphanumeric': 0.15458937198067632, 'fraction_numerical': 0.0042941492216854536, 'mean_word_length': 4.065217391304348, 'pattern_counts': {'":': 0, '<': 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': '7668184', 'n_tokens_mistral': 578, 'n_tokens_neox': 565, 'n_words': 141}